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 /test/functional | |
parent | e191fac4f3c37820f0618f72f0a8e8b524531ab8 (diff) |
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 'test/functional')
-rwxr-xr-x | test/functional/wallet_resendwallettransactions.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/test/functional/wallet_resendwallettransactions.py b/test/functional/wallet_resendwallettransactions.py index 4ef259efe1..850070dca4 100755 --- a/test/functional/wallet_resendwallettransactions.py +++ b/test/functional/wallet_resendwallettransactions.py @@ -29,12 +29,6 @@ class ResendWalletTransactionsTest(BitcoinTestFramework): self.log.info("Create a new transaction and wait until it's broadcast") txid = node.sendtoaddress(node.getnewaddress(), 1) - # Wallet rebroadcast is first scheduled 1 min sec after startup (see - # nNextResend in ResendWalletTransactions()). Tell scheduler to call - # MaybeResendWalletTxs now to initialize nNextResend before the first - # setmocktime call below. - node.mockscheduler(60) - # Can take a few seconds due to transaction trickling peer_first.wait_for_broadcast([txid]) @@ -51,7 +45,7 @@ class ResendWalletTransactionsTest(BitcoinTestFramework): block.solve() node.submitblock(block.serialize().hex()) - # Set correct m_best_block_time, which is used in ResendWalletTransactions + # Set correct m_best_block_time, which is used in ResubmitWalletTransactions node.syncwithvalidationinterfacequeue() now = int(time.time()) @@ -66,7 +60,7 @@ class ResendWalletTransactionsTest(BitcoinTestFramework): self.log.info("Bump time & check that transaction is rebroadcast") # Transaction should be rebroadcast approximately 24 hours in the future, # but can range from 12-36. So bump 36 hours to be sure. - with node.assert_debug_log(['ResendWalletTransactions: resubmit 1 unconfirmed transactions']): + with node.assert_debug_log(['resubmit 1 unconfirmed transactions']): node.setmocktime(now + 36 * 60 * 60) # Tell scheduler to call MaybeResendWalletTxs now. node.mockscheduler(60) |