Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_listsinceblock.py
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | def test_double_spend(self): | ||||
self.nodes[0].getnewaddress(): 1, | self.nodes[0].getnewaddress(): 1, | ||||
self.nodes[1].getnewaddress(): change, | self.nodes[1].getnewaddress(): change, | ||||
} | } | ||||
utxoDicts = [{ | utxoDicts = [{ | ||||
'txid': utxo['txid'], | 'txid': utxo['txid'], | ||||
'vout': utxo['vout'], | 'vout': utxo['vout'], | ||||
}] | }] | ||||
txid1 = self.nodes[1].sendrawtransaction( | txid1 = self.nodes[1].sendrawtransaction( | ||||
self.nodes[1].signrawtransaction( | self.nodes[1].signrawtransactionwithwallet( | ||||
self.nodes[1].createrawtransaction(utxoDicts, recipientDict))['hex']) | self.nodes[1].createrawtransaction(utxoDicts, recipientDict))['hex']) | ||||
# send from nodes[2] using utxo to nodes[3] | # send from nodes[2] using utxo to nodes[3] | ||||
recipientDict2 = { | recipientDict2 = { | ||||
self.nodes[3].getnewaddress(): 1, | self.nodes[3].getnewaddress(): 1, | ||||
self.nodes[2].getnewaddress(): change, | self.nodes[2].getnewaddress(): change, | ||||
} | } | ||||
self.nodes[2].sendrawtransaction( | self.nodes[2].sendrawtransaction( | ||||
self.nodes[2].signrawtransaction( | self.nodes[2].signrawtransactionwithwallet( | ||||
self.nodes[2].createrawtransaction(utxoDicts, recipientDict2))['hex']) | self.nodes[2].createrawtransaction(utxoDicts, recipientDict2))['hex']) | ||||
# generate on both sides | # generate on both sides | ||||
lastblockhash = self.nodes[1].generate(3)[2] | lastblockhash = self.nodes[1].generate(3)[2] | ||||
self.nodes[2].generate(4) | self.nodes[2].generate(4) | ||||
self.join_network() | self.join_network() | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | def test_double_send(self): | ||||
recipientDict = { | recipientDict = { | ||||
self.nodes[0].getnewaddress(): 1, | self.nodes[0].getnewaddress(): 1, | ||||
self.nodes[2].getnewaddress(): change, | self.nodes[2].getnewaddress(): change, | ||||
} | } | ||||
utxoDicts = [{ | utxoDicts = [{ | ||||
'txid': utxo['txid'], | 'txid': utxo['txid'], | ||||
'vout': utxo['vout'], | 'vout': utxo['vout'], | ||||
}] | }] | ||||
signedtxres = self.nodes[2].signrawtransaction( | signedtxres = self.nodes[2].signrawtransactionwithwallet( | ||||
self.nodes[2].createrawtransaction(utxoDicts, recipientDict)) | self.nodes[2].createrawtransaction(utxoDicts, recipientDict)) | ||||
assert signedtxres['complete'] | assert signedtxres['complete'] | ||||
signedtx = signedtxres['hex'] | signedtx = signedtxres['hex'] | ||||
# send from nodes[1]; this will end up in aa1 | # send from nodes[1]; this will end up in aa1 | ||||
txid1 = self.nodes[1].sendrawtransaction(signedtx) | txid1 = self.nodes[1].sendrawtransaction(signedtx) | ||||
Show All 38 Lines |