mining: add getTransactionsByTxID() IPC method

This commit is contained in:
Sjors Provoost
2025-12-05 19:50:58 +01:00
parent 0d5e4d4712
commit d282ae6883
6 changed files with 65 additions and 2 deletions

View File

@@ -697,15 +697,20 @@ class CTransaction:
"""Return wtxid (transaction hash with witness) as integer."""
return uint256_from_str(hash256(self.serialize_with_witness()))
@property
def txid(self):
"""Return txid (transaction hash without witness) as little-endian bytes."""
return hash256(self.serialize_without_witness())
@property
def txid_hex(self):
"""Return txid (transaction hash without witness) as hex string."""
return hash256(self.serialize_without_witness())[::-1].hex()
return self.txid[::-1].hex()
@property
def txid_int(self):
"""Return txid (transaction hash without witness) as integer."""
return uint256_from_str(hash256(self.serialize_without_witness()))
return uint256_from_str(self.txid)
def is_valid(self):
for tout in self.vout: