Merge bitcoin/bitcoin#23080: test: check abandoned tx in listsinceblock

bda620aecd test: check abandoned tx in listsinceblock (brunoerg)

Pull request description:

  This PR tests if the abandoned transaction is correct in listsinceblock return (wallet_abandonconflict.py).

ACKs for top commit:
  jonatack:
    ACK bda620aecd
  theStack:
    ACK bda620aecd
  stratospher:
    Tested ACK bda620a. This PR verifies whether the transaction txAB1 has been abandoned in listsinceblock and is a nice addition to the test!

Tree-SHA512: e4dce344cf621de7a8b5bd8660d252419772a293080fc881f6f448b6df85c6b1c8f0df619e855a40b6393f53c836f0d7fadbd3916c20cccd3a95830b8b502991
This commit is contained in:
fanquake 2021-10-18 11:41:10 +08:00
commit ef596923a8
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -120,6 +120,14 @@ class AbandonConflictTest(BitcoinTestFramework):
assert_equal(newbalance, balance + Decimal("30")) assert_equal(newbalance, balance + Decimal("30"))
balance = newbalance balance = newbalance
self.log.info("Check abandoned transactions in listsinceblock")
listsinceblock = self.nodes[0].listsinceblock()
txAB1_listsinceblock = [d for d in listsinceblock['transactions'] if d['txid'] == txAB1 and d['category'] == 'send']
for tx in txAB1_listsinceblock:
assert_equal(tx['abandoned'], True)
assert_equal(tx['confirmations'], 0)
assert_equal(tx['trusted'], False)
# Verify that even with a low min relay fee, the tx is not reaccepted from wallet on startup once abandoned # Verify that even with a low min relay fee, the tx is not reaccepted from wallet on startup once abandoned
self.restart_node(0, extra_args=["-minrelaytxfee=0.00001"]) self.restart_node(0, extra_args=["-minrelaytxfee=0.00001"])
assert self.nodes[0].getmempoolinfo()['loaded'] assert self.nodes[0].getmempoolinfo()['loaded']