diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-08-24 16:40:30 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2022-08-29 12:38:06 -0400 |
commit | 10d91c5abe9ed7dcc237c9d52c588e7d26e162a4 (patch) | |
tree | 35f27e60e47de78cc66bbd4df65284166cec5e58 /src/wallet/transaction.h | |
parent | e191fac4f3c37820f0618f72f0a8e8b524531ab8 (diff) | |
download | bitcoin-10d91c5abe9ed7dcc237c9d52c588e7d26e162a4.tar.xz |
wallet: Deduplicate Resend and ReacceptWalletTransactions
Both of these functions do almost the exact same thing. They can be
deduplicated so that their behavior matches except for the filtering
aspect. As this function will now always be called on wallet loading,
nNextResend will also always be initialized, so
wallet_resendwallettransactions.py is updated to account for that.
This also resolves a bug where ResendWalletTransactions would fail to
rebroadcast txs in insertion order thereby potentially rebroadcasting a
child transaction before its parent and causing the child to not
actually get rebroadcast.
Also names the combined function to ResubmitWalletTransactions as the
function just submits the transactions to the mempool rather than doing
any sending by itself.
Diffstat (limited to 'src/wallet/transaction.h')
-rw-r--r-- | src/wallet/transaction.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/transaction.h b/src/wallet/transaction.h index 271d698e56..27983e356d 100644 --- a/src/wallet/transaction.h +++ b/src/wallet/transaction.h @@ -305,6 +305,13 @@ public: CWalletTx(CWalletTx const &) = delete; void operator=(CWalletTx const &x) = delete; }; + +struct WalletTxOrderComparator { + bool operator()(const CWalletTx* a, const CWalletTx* b) const + { + return a->nOrderPos < b->nOrderPos; + } +}; } // namespace wallet #endif // BITCOIN_WALLET_TRANSACTION_H |