mirror of
https://git.wownero.com/wownero/wownero.git
synced 2025-01-23 15:48:35 +00:00
Merge pull request #190 from wowario/rebase
wallet2: don't store 0 amount outputs, they'll fail to be spent
This commit is contained in:
commit
bfd7154cbb
@ -1333,11 +1333,17 @@ void wallet2::scan_output(const cryptonote::transaction &tx, bool miner_tx, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
THROW_WALLET_EXCEPTION_IF(std::find(outs.begin(), outs.end(), i) != outs.end(), error::wallet_internal_error, "Same output cannot be added twice");
|
THROW_WALLET_EXCEPTION_IF(std::find(outs.begin(), outs.end(), i) != outs.end(), error::wallet_internal_error, "Same output cannot be added twice");
|
||||||
outs.push_back(i);
|
|
||||||
if (tx_scan_info.money_transfered == 0 && !miner_tx)
|
if (tx_scan_info.money_transfered == 0 && !miner_tx)
|
||||||
{
|
{
|
||||||
tx_scan_info.money_transfered = tools::decodeRct(tx.rct_signatures, tx_scan_info.received->derivation, i, tx_scan_info.mask, m_account.get_device());
|
tx_scan_info.money_transfered = tools::decodeRct(tx.rct_signatures, tx_scan_info.received->derivation, i, tx_scan_info.mask, m_account.get_device());
|
||||||
}
|
}
|
||||||
|
if (tx_scan_info.money_transfered == 0)
|
||||||
|
{
|
||||||
|
MERROR("Invalid output amount, skipping");
|
||||||
|
tx_scan_info.error = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
outs.push_back(i);
|
||||||
THROW_WALLET_EXCEPTION_IF(tx_money_got_in_outs[tx_scan_info.received->index] >= std::numeric_limits<uint64_t>::max() - tx_scan_info.money_transfered,
|
THROW_WALLET_EXCEPTION_IF(tx_money_got_in_outs[tx_scan_info.received->index] >= std::numeric_limits<uint64_t>::max() - tx_scan_info.money_transfered,
|
||||||
error::wallet_internal_error, "Overflow in received amounts");
|
error::wallet_internal_error, "Overflow in received amounts");
|
||||||
tx_money_got_in_outs[tx_scan_info.received->index] += tx_scan_info.money_transfered;
|
tx_money_got_in_outs[tx_scan_info.received->index] += tx_scan_info.money_transfered;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user