aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/transaction.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2022-08-24 16:40:30 -0400
committerAndrew Chow <github@achow101.com>2022-08-29 12:38:06 -0400
commit10d91c5abe9ed7dcc237c9d52c588e7d26e162a4 (patch)
tree35f27e60e47de78cc66bbd4df65284166cec5e58 /src/wallet/transaction.h
parente191fac4f3c37820f0618f72f0a8e8b524531ab8 (diff)
downloadbitcoin-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.h7
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