moneroexamples 7 years ago
parent 6948392191
commit cfcef1d749

@ -137,8 +137,8 @@ CurrentBlockchainStatus::calculate_emission_in_blocks(
uint64_t coinbase_amount = get_outs_money_amount(blk.miner_tx);
std::list<transaction> txs;
std::list<crypto::hash> missed_txs;
vector<transaction> txs;
vector<crypto::hash> missed_txs;
uint64_t tx_fee_amount = 0;

@ -210,78 +210,6 @@ MicroCore::find_output_in_tx(const transaction& tx,
}
/**
* Returns tx hash in a given block which
* contains given output's public key
*/
bool
MicroCore::get_tx_hash_from_output_pubkey(const public_key& output_pubkey,
const uint64_t& block_height,
crypto::hash& tx_hash,
cryptonote::transaction& tx_found)
{
tx_hash = null_hash;
// get block of given height
block blk;
if (!get_block_by_height(block_height, blk))
{
cerr << "Cant get block of height: " << block_height << endl;
return false;
}
// get all transactions in the block found
// initialize the first list with transaction for solving
// the block i.e. coinbase.
list<transaction> txs {blk.miner_tx};
list<crypto::hash> missed_txs;
if (!m_blockchain_storage.get_transactions(blk.tx_hashes, txs, missed_txs))
{
cerr << "Cant find transcations in block: " << block_height << endl;
return false;
}
if (!missed_txs.empty())
{
cerr << "Transactions not found in blk: " << block_height << endl;
for (const crypto::hash& h : missed_txs)
{
cerr << " - tx hash: " << h << endl;
}
return false;
}
// search outputs in each transactions
// until output with pubkey of interest is found
for (const transaction& tx : txs)
{
tx_out found_out;
// we dont need here output_index
size_t output_index;
if (find_output_in_tx(tx, output_pubkey, found_out, output_index))
{
// we found the desired public key
tx_hash = get_transaction_hash(tx);
tx_found = tx;
return true;
}
}
return false;
}
uint64_t
MicroCore::get_blk_timestamp(uint64_t blk_height)
{

@ -59,12 +59,6 @@ namespace xmreg
tx_out& out,
size_t& output_index);
bool
get_tx_hash_from_output_pubkey(const public_key& output_pubkey,
const uint64_t& block_height,
crypto::hash& tx_hash,
transaction& tx_found);
uint64_t
get_blk_timestamp(uint64_t blk_height);

@ -783,8 +783,8 @@ public:
// get all transactions in the block found
// initialize the first list with transaction for solving
// the block i.e. coinbase.
list<cryptonote::transaction> blk_txs {blk.miner_tx};
list<crypto::hash> missed_txs;
vector<cryptonote::transaction> blk_txs {blk.miner_tx};
vector<crypto::hash> missed_txs;
if (!core_storage->get_transactions(blk.tx_hashes, blk_txs, missed_txs))
{
@ -4671,8 +4671,8 @@ public:
json& j_txs = j_blocks.back()["txs"];
list<cryptonote::transaction> blk_txs {blk.miner_tx};
list<crypto::hash> missed_txs;
vector<cryptonote::transaction> blk_txs {blk.miner_tx};
vector<crypto::hash> missed_txs;
if (!core_storage->get_transactions(blk.tx_hashes, blk_txs, missed_txs))
{
@ -5237,8 +5237,8 @@ public:
}
// get transactions in the given block
list <cryptonote::transaction> blk_txs{blk.miner_tx};
list <crypto::hash> missed_txs;
vector<cryptonote::transaction> blk_txs{blk.miner_tx};
vector<crypto::hash> missed_txs;
if (!core_storage->get_transactions(blk.tx_hashes, blk_txs, missed_txs))
{

Loading…
Cancel
Save