@@ -56,6 +56,15 @@ def run_test(self):
56
56
assert_equal (len (self .nodes [1 ].listunspent ()), 1 )
57
57
assert_equal (len (self .nodes [2 ].listunspent ()), 0 )
58
58
59
+ self .log .info ("test gettxout" )
60
+ confirmed_txid , confirmed_index = utxos [0 ]["txid" ], utxos [0 ]["vout" ]
61
+ # First, outputs that are unspent both in the chain and in the
62
+ # mempool should appear with or without include_mempool
63
+ txout = self .nodes [0 ].gettxout (txid = confirmed_txid , n = confirmed_index , include_mempool = False )
64
+ assert_equal (txout ['value' ], 50 )
65
+ txout = self .nodes [0 ].gettxout (txid = confirmed_txid , n = confirmed_index , include_mempool = True )
66
+ assert_equal (txout ['value' ], 50 )
67
+
59
68
# Send 21 BTC from 0 to 2 using sendtoaddress call.
60
69
# Locked memory should use at least 32 bytes to sign each transaction
61
70
self .log .info ("test getmemoryinfo" )
@@ -65,10 +74,9 @@ def run_test(self):
65
74
memory_after = self .nodes [0 ].getmemoryinfo ()
66
75
assert (memory_before ['locked' ]['used' ] + 64 <= memory_after ['locked' ]['used' ])
67
76
68
- self .log .info ("test gettxout" )
77
+ self .log .info ("test gettxout (second part) " )
69
78
# utxo spent in mempool should be visible if you exclude mempool
70
79
# but invisible if you include mempool
71
- confirmed_txid , confirmed_index = utxos [0 ]["txid" ], utxos [0 ]["vout" ]
72
80
txout = self .nodes [0 ].gettxout (confirmed_txid , confirmed_index , False )
73
81
assert_equal (txout ['value' ], 50 )
74
82
txout = self .nodes [0 ].gettxout (confirmed_txid , confirmed_index , True )
0 commit comments