mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 01:42:58 +01:00
test: add tx_in_orphanage()
Allows tests to check if a transaction is contained within the orphanage
This commit is contained in:
parent
34a9c10e8c
commit
93f48fceb7
@ -8,6 +8,7 @@ from decimal import Decimal
|
||||
from .blocktools import (
|
||||
COINBASE_MATURITY,
|
||||
)
|
||||
from .messages import CTransaction
|
||||
from .util import (
|
||||
assert_equal,
|
||||
assert_greater_than,
|
||||
@ -83,3 +84,8 @@ def fill_mempool(test_framework, node, *, tx_sync_fun=None):
|
||||
test_framework.log.debug("Check that mempoolminfee is larger than minrelaytxfee")
|
||||
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
|
||||
assert_greater_than(node.getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
|
||||
|
||||
def tx_in_orphanage(node, tx: CTransaction) -> bool:
|
||||
"""Returns true if the transaction is in the orphanage."""
|
||||
found = [o for o in node.getorphantxs(verbosity=1) if o["txid"] == tx.rehash() and o["wtxid"] == tx.getwtxid()]
|
||||
return len(found) == 1
|
||||
|
Loading…
Reference in New Issue
Block a user