Test that scriptpubkey watches also trigger rescan
(node_factory, bitcoind)
| 5322 | |
| 5323 | |
| 5324 | def test_bwatch_rescan_scriptpubkey(node_factory, bitcoind): |
| 5325 | """Test that scriptpubkey watches also trigger rescan""" |
| 5326 | l1 = node_factory.get_node(options=BWATCH_OPTS) |
| 5327 | |
| 5328 | # Wait for bwatch to fully sync |
| 5329 | l1.daemon.wait_for_log(r'No block change') |
| 5330 | |
| 5331 | info = l1.rpc.getinfo() |
| 5332 | current_height = info['blockheight'] |
| 5333 | |
| 5334 | test_spk = "76a914" + "11" * 20 + "88ac" |
| 5335 | start_block = current_height - 3 |
| 5336 | |
| 5337 | l1.rpc.addscriptpubkeywatch(owner='wallet/p2wpkh/0', scriptpubkey=test_spk, start_block=start_block) |
| 5338 | |
| 5339 | l1.daemon.wait_for_log(rf'Starting rescan for scriptpubkey watch: blocks {start_block}-{current_height}') |
| 5340 | l1.daemon.wait_for_log(r'Rescan complete') |
| 5341 | |
| 5342 | |
| 5343 | @pytest.mark.slow_test |
nothing calls this directly
no test coverage detected