diff --git a/test/functional/rpc_fundrawtransaction.py b/test/functional/rpc_fundrawtransaction.py index 50bbd70ada..d65f976467 100755 --- a/test/functional/rpc_fundrawtransaction.py +++ b/test/functional/rpc_fundrawtransaction.py @@ -27,8 +27,10 @@ def get_unspent(listunspent, amount): class RawTransactionsTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 4 - self.extra_args = [["-blindedaddresses=1"]] * self.num_nodes self.setup_clean_chain = True + # This test isn't testing tx relay. Set whitelist on the peers for + # instant tx relay. + self.extra_args = [['-blindedaddresses=1', '-whitelist=127.0.0.1']] * self.num_nodes def skip_test_if_missing_module(self): self.skip_if_no_wallet() @@ -488,8 +490,7 @@ class RawTransactionsTest(BitcoinTestFramework): # Send 1.2 BTC to msig addr. self.nodes[0].sendtoaddress(mSigObj, 1.2) - self.sync_all() - self.nodes[1].generate(1) + self.nodes[0].generate(1) self.sync_all() oldBalance = self.nodes[1].getbalance()['bitcoin'] @@ -501,8 +502,7 @@ class RawTransactionsTest(BitcoinTestFramework): blindedTx = self.nodes[2].blindrawtransaction(fundedTx['hex']) signedTx = self.nodes[2].signrawtransactionwithwallet(blindedTx) self.nodes[2].sendrawtransaction(signedTx['hex']) - self.sync_all() - self.nodes[1].generate(1) + self.nodes[2].generate(1) self.sync_all() # make sure funds are received at node1. @@ -512,22 +512,6 @@ class RawTransactionsTest(BitcoinTestFramework): self.log.info("Test fundrawtxn with locked wallet") self.nodes[1].encryptwallet("test") - self.stop_nodes() - - self.start_nodes() - # This test is not meant to test fee estimation and we'd like - # to be sure all txns are sent at a consistent desired feerate. - for node in self.nodes: - node.settxfee(self.min_relay_tx_fee) - - connect_nodes(self.nodes[0], 1) - connect_nodes(self.nodes[1], 2) - connect_nodes(self.nodes[0], 2) - connect_nodes(self.nodes[0], 3) - # Again lock the watchonly UTXO or nodes[0] may spend it, because - # lockunspent is memory-only and thus lost on restart. - self.nodes[0].lockunspent(False, [{"txid": self.watchonly_txid, "vout": self.watchonly_vout}]) - self.sync_all() # Drain the keypool. self.nodes[1].getnewaddress() @@ -568,9 +552,8 @@ class RawTransactionsTest(BitcoinTestFramework): """Multiple (~19) inputs tx test | Compare fee.""" self.log.info("Test fundrawtxn fee with many inputs") - #empty node1, send some small coins from node0 to node1. + # Empty node1, send some small coins from node0 to node1. self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance()['bitcoin'], "", "", True) - self.sync_all() self.nodes[0].generate(1) self.sync_all() @@ -598,9 +581,8 @@ class RawTransactionsTest(BitcoinTestFramework): """Multiple (~19) inputs tx test | sign/send.""" self.log.info("Test fundrawtxn sign+send with many inputs") - #again, empty node1, send some small coins from node0 to node1. + # Again, empty node1, send some small coins from node0 to node1. self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance()['bitcoin'], "", "", True) - self.sync_all() self.nodes[0].generate(1) self.sync_all() @@ -619,8 +601,7 @@ class RawTransactionsTest(BitcoinTestFramework): blindedTx = self.nodes[1].blindrawtransaction(fundedTx['hex']) fundedAndSignedTx = self.nodes[1].signrawtransactionwithwallet(blindedTx) self.nodes[1].sendrawtransaction(fundedAndSignedTx['hex']) - self.sync_all() - self.nodes[0].generate(1) + self.nodes[1].generate(1) self.sync_all() assert_equal(oldBalance+Decimal('50.19000000'), self.nodes[0].getbalance()['bitcoin']) #0.19+block reward