The miniwallet will rescan the chain and mempool on construction. If the mempools are still in sync, it may lead to crashes. Fix that by moving the sync first.
Fixes #26937
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | theStack |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Code-review ACK fa88c043d19f15a8716c11102b0db3c68501db28
FWIW, I think another alternative would be to simply avoid scanning the mempool in the MiniWallet ctor:
index f3253630c4..91c870a859 100644
--- a/test/functional/test_framework/wallet.py
+++ b/test/functional/test_framework/wallet.py
@@ -106,7 +106,7 @@ class MiniWallet:
# (see method BitcoinTestFramework._initialize_chain())
# The MiniWallet needs to rescan_utxos() in order to account
# for those mature UTXOs, so that all txs spend confirmed coins
- self.rescan_utxos()
+ self.rescan_utxos(include_mempool=False)
def _create_utxo(self, *, txid, vout, value, height, coinbase, confirmations):
return {"txid": txid, "vout": vout, "value": value, "height": height, "coinbase": coinbase, "confirmations": confirmations}
FWIW, I think another alternative would be to simply avoid scanning the mempool in the MiniWallet ctor:
If this is done, it might be good to use kwargs to pass through the option and set it in the rbf test. I opted for my solution, because rescanning after the block is mined has the minor benefit that miniwallet's utxos have the right height/confirmations set
Milestone
25.0