aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Kazenyuk <sergey@kazenyuk.com>2015-03-15 04:22:25 +0300
committerSergey Kazenyuk <sergey@kazenyuk.com>2015-03-15 04:33:34 +0300
commit3be518ff40f84f51de1b347feb5bf9047d974730 (patch)
treeffc15528af611f7a4cb6fcf8c922ead6f8ef3049
parentMerge pull request #238 (diff)
downloadmonero-3be518ff40f84f51de1b347feb5bf9047d974730.tar.xz
Use single get_transaction_hash to get both id and blob size
-rw-r--r--src/cryptonote_core/blockchain_storage.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain_storage.cpp b/src/cryptonote_core/blockchain_storage.cpp
index 42269e05c..f79f10320 100644
--- a/src/cryptonote_core/blockchain_storage.cpp
+++ b/src/cryptonote_core/blockchain_storage.cpp
@@ -1642,10 +1642,12 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt
bvc.m_verifivation_failed = true;
return false;
}
- size_t coinbase_blob_size = get_object_blobsize(bl.miner_tx);
+ crypto::hash coinbase_hash = null_hash;
+ size_t coinbase_blob_size = 0;
+ get_transaction_hash(bl.miner_tx, coinbase_hash, coinbase_blob_size);
size_t cumulative_block_size = coinbase_blob_size;
//process transactions
- if(!add_transaction_from_block(bl.miner_tx, get_transaction_hash(bl.miner_tx), id, get_current_blockchain_height()))
+ if(!add_transaction_from_block(bl.miner_tx, coinbase_hash, id, get_current_blockchain_height()))
{
LOG_PRINT_L1("Block with id: " << id << " failed to add transaction to blockchain storage");
bvc.m_verifivation_failed = true;