Changeset View
Changeset View
Standalone View
Standalone View
test/functional/mempool_unbroadcast.py
Show All 28 Lines | def run_test(self): | ||||
self.test_txn_removal() | self.test_txn_removal() | ||||
def test_broadcast(self): | def test_broadcast(self): | ||||
self.log.info( | self.log.info( | ||||
"Test that mempool reattempts delivery of locally submitted transaction") | "Test that mempool reattempts delivery of locally submitted transaction") | ||||
node = self.nodes[0] | node = self.nodes[0] | ||||
min_relay_fee = node.getnetworkinfo()["relayfee"] | min_relay_fee = node.getnetworkinfo()["relayfee"] | ||||
utxos = create_confirmed_utxos(node, 10) | create_confirmed_utxos(node, 10) | ||||
disconnect_nodes(node, self.nodes[1]) | disconnect_nodes(node, self.nodes[1]) | ||||
self.log.info("Generate transactions that only node 0 knows about") | self.log.info("Generate transactions that only node 0 knows about") | ||||
# generate a wallet txn | # generate a wallet txn | ||||
addr = node.getnewaddress() | addr = node.getnewaddress() | ||||
wallet_tx_hsh = node.sendtoaddress(addr, 0.0001) | wallet_tx_hsh = node.sendtoaddress(addr, 0.0001) | ||||
utxos = node.listunspent() | |||||
# generate a txn using sendrawtransaction | # generate a txn using sendrawtransaction | ||||
us0 = utxos.pop() | us0 = utxos.pop() | ||||
inputs = [{"txid": us0["txid"], "vout": us0["vout"]}] | inputs = [{"txid": us0["txid"], "vout": us0["vout"]}] | ||||
outputs = {addr: 0.0001} | outputs = {addr: 0.0001} | ||||
tx = node.createrawtransaction(inputs, outputs) | tx = node.createrawtransaction(inputs, outputs) | ||||
node.settxfee(min_relay_fee) | node.settxfee(min_relay_fee) | ||||
txF = node.fundrawtransaction(tx) | txF = node.fundrawtransaction(tx) | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |