mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03: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
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue