SideChain: reduce lock scope in get_outputs_blob

pull/226/head
SChernykh 2 years ago
parent 488ed8e562
commit 79a31ce57c

@ -696,6 +696,9 @@ bool SideChain::get_outputs_blob(PoolBlock* block, uint64_t total_reward, std::v
{
blob.clear();
std::vector<MinerShare> tmpShares;
std::vector<uint64_t> tmpRewards;
{
ReadLock lock(m_sidechainLock);
auto it = m_blocksById.find(block->m_sidechainId);
@ -722,12 +725,10 @@ bool SideChain::get_outputs_blob(PoolBlock* block, uint64_t total_reward, std::v
return true;
}
std::vector<MinerShare> tmpShares;
std::vector<uint64_t> tmpRewards;
if (!get_shares(block, tmpShares) || !split_reward(total_reward, tmpShares, tmpRewards) || (tmpRewards.size() != tmpShares.size())) {
return false;
}
}
const size_t n = tmpShares.size();

Loading…
Cancel
Save