mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 10:42:13 +02:00
rpc: Add missing BlockUntilSyncedToCurrentChain to wallet RPCs
Wallet RPCs that allow a rescan based on block-timestamp or block-height need to sync with the active chain first, because the user might assume the wallet is up-to-date with the latest block they got reported via a blockchain RPC.
This commit is contained in:
@@ -65,7 +65,6 @@ class ImportMultiTest(BitcoinTestFramework):
|
||||
self.generate(self.nodes[0], 1, sync_fun=self.no_op)
|
||||
self.generate(self.nodes[1], 1, sync_fun=self.no_op)
|
||||
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
|
||||
self.nodes[1].syncwithvalidationinterfacequeue() # Sync the timestamp to the wallet, so that importmulti works
|
||||
|
||||
node0_address1 = self.nodes[0].getaddressinfo(self.nodes[0].getnewaddress())
|
||||
|
||||
@@ -260,7 +259,6 @@ class ImportMultiTest(BitcoinTestFramework):
|
||||
self.nodes[1].sendtoaddress(multisig.p2sh_addr, 10.00)
|
||||
self.generate(self.nodes[1], 1, sync_fun=self.no_op)
|
||||
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
|
||||
self.nodes[1].syncwithvalidationinterfacequeue()
|
||||
|
||||
self.log.info("Should import a p2sh")
|
||||
self.test_importmulti({"scriptPubKey": {"address": multisig.p2sh_addr},
|
||||
@@ -281,7 +279,6 @@ class ImportMultiTest(BitcoinTestFramework):
|
||||
self.nodes[1].sendtoaddress(multisig.p2sh_addr, 10.00)
|
||||
self.generate(self.nodes[1], 1, sync_fun=self.no_op)
|
||||
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
|
||||
self.nodes[1].syncwithvalidationinterfacequeue()
|
||||
|
||||
self.log.info("Should import a p2sh with respective redeem script")
|
||||
self.test_importmulti({"scriptPubKey": {"address": multisig.p2sh_addr},
|
||||
@@ -302,7 +299,6 @@ class ImportMultiTest(BitcoinTestFramework):
|
||||
self.nodes[1].sendtoaddress(multisig.p2sh_addr, 10.00)
|
||||
self.generate(self.nodes[1], 1, sync_fun=self.no_op)
|
||||
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
|
||||
self.nodes[1].syncwithvalidationinterfacequeue()
|
||||
|
||||
self.log.info("Should import a p2sh with respective redeem script and private keys")
|
||||
self.test_importmulti({"scriptPubKey": {"address": multisig.p2sh_addr},
|
||||
@@ -328,7 +324,6 @@ class ImportMultiTest(BitcoinTestFramework):
|
||||
self.nodes[1].sendtoaddress(multisig.p2sh_addr, 10.00)
|
||||
self.generate(self.nodes[1], 1, sync_fun=self.no_op)
|
||||
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
|
||||
self.nodes[1].syncwithvalidationinterfacequeue()
|
||||
|
||||
self.log.info("Should import a p2sh with respective redeem script and private keys")
|
||||
self.test_importmulti({"scriptPubKey": {"address": multisig.p2sh_addr},
|
||||
|
||||
Reference in New Issue
Block a user