forked from lthn/blockchain
potential fix for preventing data race
This commit is contained in:
parent
23f3593ae0
commit
7d3bd99867
2 changed files with 6 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 (...) \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue