1
0
Fork 0
forked from lthn/blockchain

potential fix for preventing data race

This commit is contained in:
cryptozoidberg 2025-04-01 21:51:46 +04:00
parent 23f3593ae0
commit 7d3bd99867
No known key found for this signature in database
GPG key ID: 2E10CC61CAC8F36D
2 changed files with 6 additions and 7 deletions

View file

@ -195,14 +195,13 @@ namespace currency
inline crypto::hash get_coinbase_hash_cached(const block_extended_info& bei)
{
if (bei.m_cache_coinbase_id)
{
return *bei.m_cache_coinbase_id;
}
else
std::shared_ptr<crypto::hash> local_coinbase_id = bei.m_cache_coinbase_id;
if (!local_coinbase_id)
{
bei.m_cache_coinbase_id = std::make_shared<crypto::hash>(get_transaction_hash(bei.bl.miner_tx));
return *bei.m_cache_coinbase_id;
local_coinbase_id = bei.m_cache_coinbase_id;
}
return *local_coinbase_id;
}
} // namespace currency

View file

@ -56,7 +56,7 @@ POP_VS_WARNINGS
catch (const std::exception& e) \
{ \
er.code = WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR; \
er.message = std::string("WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR") + e.what(); \
er.message = std::string("WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR: ") + e.what(); \
return false; \
} \
catch (...) \