mirror of
https://github.com/monero-project/monero.git
synced 2025-08-23 13:25:04 -04:00
Merge pull request #8796
7a4a03d
wallet2: do not commit transactions more than once (moneromooo-monero)
This commit is contained in:
commit
df2eb0da0a
2 changed files with 52 additions and 0 deletions
|
@ -6753,6 +6753,24 @@ void wallet2::commit_tx(pending_tx& ptx)
|
|||
crypto::hash txid;
|
||||
|
||||
txid = get_transaction_hash(ptx.tx);
|
||||
|
||||
// if it's already processed, bail
|
||||
if (std::find_if(m_transfers.begin(), m_transfers.end(), [&txid](const transfer_details &td) { return td.m_txid == txid; }) != m_transfers.end())
|
||||
{
|
||||
MDEBUG("Transaction " << txid << " already processed");
|
||||
return;
|
||||
}
|
||||
if (m_unconfirmed_txs.find(txid) != m_unconfirmed_txs.end())
|
||||
{
|
||||
MDEBUG("Transaction " << txid << " already processed");
|
||||
return;
|
||||
}
|
||||
if (m_confirmed_txs.find(txid) != m_confirmed_txs.end())
|
||||
{
|
||||
MDEBUG("Transaction " << txid << " already processed");
|
||||
return;
|
||||
}
|
||||
|
||||
crypto::hash payment_id = crypto::null_hash;
|
||||
std::vector<cryptonote::tx_destination_entry> dests;
|
||||
uint64_t amount_in = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue