Skip to content

Commit fd9b3a7

Browse files
committed
test: Output should be unlocked when spent
1 parent 54c3bb4 commit fd9b3a7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/functional/wallet_basic.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ def run_test(self):
130130
self.nodes[2].lockunspent, False,
131131
[{"txid": unspent_0["txid"], "vout": 999}])
132132

133+
# An output should be unlocked when spent
134+
unspent_0 = self.nodes[1].listunspent()[0]
135+
self.nodes[1].lockunspent(False, [unspent_0])
136+
tx = self.nodes[1].createrawtransaction([unspent_0], { self.nodes[1].getnewaddress() : 1 })
137+
tx = self.nodes[1].fundrawtransaction(tx)['hex']
138+
tx = self.nodes[1].signrawtransactionwithwallet(tx)["hex"]
139+
self.nodes[1].sendrawtransaction(tx)
140+
assert_equal(len(self.nodes[1].listlockunspent()), 0)
141+
133142
# Have node1 generate 100 blocks (so node0 can recover the fee)
134143
self.nodes[1].generate(100)
135144
self.sync_all([self.nodes[0:3]])

0 commit comments

Comments
 (0)