Skip to content

Commit 96f1b2d

Browse files
committed
Merge bitcoin/bitcoin#26091: test: Fix syncwithvalidationinterfacequeue calls
fa1ce96 test: Add missing syncwithvalidationinterfacequeue (MacroFake) faa4916 test/doc: Remove unused syncwithvalidationinterfacequeue (MacroFake) Pull request description: Fixes #26071 ACKs for top commit: achow101: ACK fa1ce96 glozow: ACK fa1ce96 w0xlt: ACK bitcoin/bitcoin@fa1ce96 Tree-SHA512: d1e101b55477360ead2b99ade5d42b922aabe293ec84fb26764e29161c5be6c534aef6f22d2cc5ea63a4bd6b6e77b701f1a7a2283b8e7e815d343a604cd77656
2 parents f332c4f + fa1ce96 commit 96f1b2d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/wallet/wallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ bool CWallet::MarkReplaced(const uint256& originalHash, const uint256& newHash)
882882

883883
wtx.mapValue["replaced_by_txid"] = newHash.ToString();
884884

885-
// Refresh mempool status without waiting for transactionRemovedFromMempool
885+
// Refresh mempool status without waiting for transactionRemovedFromMempool or transactionAddedToMempool
886886
RefreshMempoolStatus(wtx, chain());
887887

888888
WalletBatch batch(GetDatabase());
@@ -1920,7 +1920,7 @@ std::set<uint256> CWallet::GetTxConflicts(const CWalletTx& wtx) const
19201920
// The `force` option results in all unconfirmed transactions being submitted to
19211921
// the mempool. This does not necessarily result in those transactions being relayed,
19221922
// that depends on the `relay` option. Periodic rebroadcast uses the pattern
1923-
// relay=true force=false (also the default values), while loading into the mempool
1923+
// relay=true force=false, while loading into the mempool
19241924
// (on start, or after import) uses relay=false force=true.
19251925
void CWallet::ResubmitWalletTransactions(bool relay, bool force)
19261926
{

test/functional/wallet_resendwallettransactions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ def run_test(self):
8989
if txids == [child_txid, txid]:
9090
break
9191
bumped = node.bumpfee(child_txid)
92+
# The scheduler queue creates a copy of the added tx after
93+
# send/bumpfee and re-adds it to the wallet (undoing the next
94+
# removeprunedfunds). So empty the scheduler queue:
95+
node.syncwithvalidationinterfacequeue()
9296
node.removeprunedfunds(child_txid)
9397
child_txid = bumped["txid"]
9498
entry_time = node.getmempoolentry(child_txid)["time"]
@@ -98,13 +102,13 @@ def run_test(self):
98102
block = create_block(int(node.getbestblockhash(), 16), create_coinbase(node.getblockcount() + 1), block_time)
99103
block.solve()
100104
node.submitblock(block.serialize().hex())
105+
# Set correct m_best_block_time, which is used in ResubmitWalletTransactions
101106
node.syncwithvalidationinterfacequeue()
102107

103108
# Evict these txs from the mempool
104109
evict_time = block_time + 60 * 60 * DEFAULT_MEMPOOL_EXPIRY_HOURS + 5
105110
node.setmocktime(evict_time)
106111
indep_send = node.send(outputs=[{node.getnewaddress(): 1}], options={"inputs": [indep_utxo]})
107-
node.syncwithvalidationinterfacequeue()
108112
node.getmempoolentry(indep_send["txid"])
109113
assert_raises_rpc_error(-5, "Transaction not in mempool", node.getmempoolentry, txid)
110114
assert_raises_rpc_error(-5, "Transaction not in mempool", node.getmempoolentry, child_txid)

0 commit comments

Comments
 (0)