diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 13 | ||||
-rw-r--r-- | src/wallet/wallet_rpc_helpers.h | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index b7e9f4ca2..b13ecbbf1 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1765,9 +1765,18 @@ bool Blockchain::handle_alternative_block(const block& b, const crypto::hash& id { cryptonote::tx_memory_pool::tx_details td; cryptonote::blobdata blob; - if (m_tx_pool.get_transaction_info(txid, td)) + if (m_tx_pool.have_tx(txid)) { - bei.block_cumulative_weight += td.weight; + if (m_tx_pool.get_transaction_info(txid, td)) + { + bei.block_cumulative_weight += td.weight; + } + else + { + MERROR_VER("Transaction is in the txpool, but metadata not found"); + bvc.m_verifivation_failed = true; + return false; + } } else if (m_db->get_pruned_tx_blob(txid, blob)) { diff --git a/src/wallet/wallet_rpc_helpers.h b/src/wallet/wallet_rpc_helpers.h index 91803ff77..4291a112d 100644 --- a/src/wallet/wallet_rpc_helpers.h +++ b/src/wallet/wallet_rpc_helpers.h @@ -65,7 +65,7 @@ namespace tools rpc_payment_state.credits = post_call_credits; rpc_payment_state.expected_spent += expected_credits; - if (pre_call_credits < post_call_credits) + if (pre_call_credits <= post_call_credits) return; uint64_t cost = pre_call_credits - post_call_credits; |