forked from lthn/blockchain
wallet: fixed a rare bug in generate_packing_transaction_if_needed
This commit is contained in:
parent
2ee199bcbc
commit
c7db3f0fee
1 changed files with 3 additions and 1 deletions
|
|
@ -2324,7 +2324,7 @@ bool wallet2::generate_packing_transaction_if_needed(currency::transaction& tx,
|
||||||
{
|
{
|
||||||
prepare_free_transfers_cache(0);
|
prepare_free_transfers_cache(0);
|
||||||
auto it = m_found_free_amounts.find(CURRENCY_BLOCK_REWARD);
|
auto it = m_found_free_amounts.find(CURRENCY_BLOCK_REWARD);
|
||||||
if (it == m_found_free_amounts.end() || it->second.size() < m_pos_mint_packing_size)
|
if (it == m_found_free_amounts.end() || it->second.size() <= m_pos_mint_packing_size)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//let's check if we have at least WALLET_POS_MINT_PACKING_SIZE transactions which is ready to go
|
//let's check if we have at least WALLET_POS_MINT_PACKING_SIZE transactions which is ready to go
|
||||||
|
|
@ -2343,7 +2343,9 @@ bool wallet2::generate_packing_transaction_if_needed(currency::transaction& tx,
|
||||||
ctp.dsts.push_back(de);
|
ctp.dsts.push_back(de);
|
||||||
ctp.perform_packing = true;
|
ctp.perform_packing = true;
|
||||||
|
|
||||||
|
TRY_ENTRY();
|
||||||
transfer(ctp, tx, false, nullptr);
|
transfer(ctp, tx, false, nullptr);
|
||||||
|
CATCH_ENTRY2(false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue