aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-09-16 16:30:43 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-09-16 16:38:14 +0200
commit58e02395bad59359cc0210f2ab633d0a82827ba4 (patch)
tree0b04435a58a94ed910395cd7cd5a86739603c75b /test/functional/test_framework
parent6d76b57ca0cdf6f9c19ce065b9a4a628930a78b5 (diff)
parentfa66a7d732f9fd60d72f22087f0d5aadf3064bfb (diff)
downloadbitcoin-58e02395bad59359cc0210f2ab633d0a82827ba4.tar.xz
Merge bitcoin/bitcoin#22955: p2p: Rename fBlocksOnly, Add test
fa66a7d732f9fd60d72f22087f0d5aadf3064bfb p2p: Rename fBlocksOnly, Add test (MarcoFalke) fac66d0a39cb0b4bc565b57087ba84dd932e9b6d test: Simplify p2p_blocksonly test with new miniwallet rescan_utxos method (MarcoFalke) Pull request description: `fBlocksOnly` has several issues: * The name is confusing * It is untested Fix both. ACKs for top commit: laanwj: Code review ACK fa66a7d732f9fd60d72f22087f0d5aadf3064bfb Tree-SHA512: 4218f455eeb37297f74603d7d44895288605844ae828a40dfb7a70215f1a058ac5ad945a22732f5ebcad3ad375d54ba360bea69ea79639a30d4c88b042448f0f
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r--test/functional/test_framework/wallet.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py
index ba5b95f930..08086bc0b9 100644
--- a/test/functional/test_framework/wallet.py
+++ b/test/functional/test_framework/wallet.py
@@ -79,6 +79,14 @@ class MiniWallet:
self._address = ADDRESS_BCRT1_P2WSH_OP_TRUE
self._scriptPubKey = bytes.fromhex(self._test_node.validateaddress(self._address)['scriptPubKey'])
+ def rescan_utxos(self):
+ """Drop all utxos and rescan the utxo set"""
+ self._utxos = []
+ res = self._test_node.scantxoutset(action="start", scanobjects=[f'raw({self._scriptPubKey.hex()})'])
+ assert_equal(True, res['success'])
+ for utxo in res['unspents']:
+ self._utxos.append({'txid': utxo['txid'], 'vout': utxo['vout'], 'value': utxo['amount']})
+
def scan_blocks(self, *, start=1, num):
"""Scan the blocks for self._address outputs and add them to self._utxos"""
for i in range(start, start + num):