Changeset View
Changeset View
Standalone View
Standalone View
test/functional/fundrawtransaction.py
Show All 18 Lines | |||||
class RawTransactionsTest(BitcoinTestFramework): | class RawTransactionsTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 4 | self.num_nodes = 4 | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
def setup_network(self, split=False): | def setup_network(self, split=False): | ||||
self.setup_nodes() | self.setup_nodes() | ||||
connect_nodes_bi(self.nodes, 0, 1) | connect_nodes_bi(self.nodes[0], self.nodes[1]) | ||||
connect_nodes_bi(self.nodes, 1, 2) | connect_nodes_bi(self.nodes[1], self.nodes[2]) | ||||
connect_nodes_bi(self.nodes, 0, 2) | connect_nodes_bi(self.nodes[0], self.nodes[2]) | ||||
connect_nodes_bi(self.nodes, 0, 3) | connect_nodes_bi(self.nodes[0], self.nodes[3]) | ||||
def run_test(self): | def run_test(self): | ||||
min_relay_tx_fee = self.nodes[0].getnetworkinfo()['relayfee'] | min_relay_tx_fee = self.nodes[0].getnetworkinfo()['relayfee'] | ||||
# This test is not meant to test fee estimation and we'd like | # This test is not meant to test fee estimation and we'd like | ||||
# to be sure all txs are sent at a consistent desired feerate | # to be sure all txs are sent at a consistent desired feerate | ||||
for node in self.nodes: | for node in self.nodes: | ||||
node.settxfee(min_relay_tx_fee) | node.settxfee(min_relay_tx_fee) | ||||
▲ Show 20 Lines • Show All 424 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.stop_node(3) | self.stop_node(3) | ||||
self.start_nodes() | self.start_nodes() | ||||
# This test is not meant to test fee estimation and we'd like | # This test is not meant to test fee estimation and we'd like | ||||
# to be sure all txs are sent at a consistent desired feerate | # to be sure all txs are sent at a consistent desired feerate | ||||
for node in self.nodes: | for node in self.nodes: | ||||
node.settxfee(min_relay_tx_fee) | node.settxfee(min_relay_tx_fee) | ||||
connect_nodes_bi(self.nodes, 0, 1) | connect_nodes_bi(self.nodes[0], self.nodes[1]) | ||||
connect_nodes_bi(self.nodes, 1, 2) | connect_nodes_bi(self.nodes[1], self.nodes[2]) | ||||
connect_nodes_bi(self.nodes, 0, 2) | connect_nodes_bi(self.nodes[0], self.nodes[2]) | ||||
connect_nodes_bi(self.nodes, 0, 3) | connect_nodes_bi(self.nodes[0], self.nodes[3]) | ||||
self.sync_all() | self.sync_all() | ||||
# drain the keypool | # drain the keypool | ||||
self.nodes[1].getnewaddress() | self.nodes[1].getnewaddress() | ||||
self.nodes[1].getrawchangeaddress() | self.nodes[1].getrawchangeaddress() | ||||
inputs = [] | inputs = [] | ||||
outputs = {self.nodes[0].getnewaddress(): 1.1} | outputs = {self.nodes[0].getnewaddress(): 1.1} | ||||
rawTx = self.nodes[1].createrawtransaction(inputs, outputs) | rawTx = self.nodes[1].createrawtransaction(inputs, outputs) | ||||
▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines |