@@ -56,6 +56,15 @@ def run_test(self):
5656 assert_equal (len (self .nodes [1 ].listunspent ()), 1 )
5757 assert_equal (len (self .nodes [2 ].listunspent ()), 0 )
5858
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+
5968 # Send 21 BTC from 0 to 2 using sendtoaddress call.
6069 # Locked memory should use at least 32 bytes to sign each transaction
6170 self .log .info ("test getmemoryinfo" )
@@ -65,10 +74,9 @@ def run_test(self):
6574 memory_after = self .nodes [0 ].getmemoryinfo ()
6675 assert (memory_before ['locked' ]['used' ] + 64 <= memory_after ['locked' ]['used' ])
6776
68- self .log .info ("test gettxout" )
77+ self .log .info ("test gettxout (second part) " )
6978 # utxo spent in mempool should be visible if you exclude mempool
7079 # but invisible if you include mempool
71- confirmed_txid , confirmed_index = utxos [0 ]["txid" ], utxos [0 ]["vout" ]
7280 txout = self .nodes [0 ].gettxout (confirmed_txid , confirmed_index , False )
7381 assert_equal (txout ['value' ], 50 )
7482 txout = self .nodes [0 ].gettxout (confirmed_txid , confirmed_index , True )
0 commit comments