Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_txn_doublespend.py
Show All 30 Lines | def setup_network(self): | ||||
# Start with split network: | # Start with split network: | ||||
super().setup_network() | super().setup_network() | ||||
disconnect_nodes(self.nodes[1], self.nodes[2]) | disconnect_nodes(self.nodes[1], self.nodes[2]) | ||||
disconnect_nodes(self.nodes[2], self.nodes[1]) | disconnect_nodes(self.nodes[2], self.nodes[1]) | ||||
def run_test(self): | def run_test(self): | ||||
# All nodes should start with 1,250 BCH: | # All nodes should start with 1,250 BCH: | ||||
starting_balance = 1250 | starting_balance = 1250 | ||||
# All nodes should be out of IBD. | |||||
# If the nodes are not all out of IBD, that can interfere with | |||||
# blockchain sync later in the test when nodes are connected, due to | |||||
# timing issues. | |||||
for n in self.nodes: | |||||
assert n.getblockchaininfo()["initialblockdownload"] is False | |||||
for i in range(4): | for i in range(4): | ||||
assert_equal(self.nodes[i].getbalance(), starting_balance) | assert_equal(self.nodes[i].getbalance(), starting_balance) | ||||
# bug workaround, coins generated assigned to first getnewaddress! | # bug workaround, coins generated assigned to first getnewaddress! | ||||
self.nodes[i].getnewaddress("") | self.nodes[i].getnewaddress("") | ||||
# Assign coins to foo and bar addresses: | # Assign coins to foo and bar addresses: | ||||
node0_address_foo = self.nodes[0].getnewaddress() | node0_address_foo = self.nodes[0].getnewaddress() | ||||
fund_foo_txid = self.nodes[0].sendtoaddress(node0_address_foo, 1219) | fund_foo_txid = self.nodes[0].sendtoaddress(node0_address_foo, 1219) | ||||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |