Skip to content

Parsed transaction don't have all the data #281

@ravi-ojha

Description

@ravi-ojha

Example snippet:

from bitcoinlib.services.services import Service

txid = 'cc3afefe30dda8c31cbd39ad19efbdb14a28ac048d28fcf1cfc37c4bc424150b'
s = Service(providers=['bitcoind'], strict=True)

t = s.gettransaction(txid)

It logs the error Malformed script, not enough data found but returns the Transaction object.

This Transaction object has some empty params.

For eg: Notice that the address field is empty in the inputs

{'coinbase': False,
 'inputs': [<Input(prev_txid='b7243353f67cb799db171f21d1e8af045b5ec60babeab22a8bdc3c6813de8946', output_n=0, address='', index_n=0, type='sig_pubkey')>],
 'outputs': [<Output(value=2337, address=bc1qemqrchhnc336m70zm4ryn8jdcrmz596j0msagk5c7tt93wejwvvsz0gja0, type=p2wpkh)>],
 'version': b'\x00\x00\x00\x02',
 'version_int': 2,
 'locktime': 0,
 'network': <Network: bitcoin>,
 'flag': b'\x01',
 'fee': 163,
 'fee_per_kb': 1455,
 'size': 163,
 'vsize': 112,
 'txid': 'cc3afefe30dda8c31cbd39ad19efbdb14a28ac048d28fcf1cfc37c4bc424150b',
 'txhash': '',
 'date': datetime.datetime(2022, 12, 20, 13, 40, 1),
 'confirmations': 2,
 'block_height': 768220,
 'block_hash': '000000000000000000057c5fbaf55b31ed6e3f3c39a00b68e25a1dc9ce77af4a',
 'input_total': 2500,
 'output_total': 2337,
 'rawtx': b'\x02\x00\x00\x00\x00\x01\x01F\x89\xde\x13h<\xdc\x8b*\xb2\xea\xab\x0b\xc6^[\x04\xaf\xe8\xd1!\x1f\x17\xdb\x99\xb7|\xf6S3$\xb7\x00\x00\x00\x00\x00\xff\xff\xff\xff\x01!\t\x00\x00\x00\x00\x00\x00"\x00 \xce\xc0<^\xf3\xc4c\xad\xf9\xe2\xddFI\x9eM\xc0\xf6*\x17R~\xe1\xd4Z\x98\xf2\xd6X\xbb2s\x19\x01A\x11e\x0e\x81\xca\xbd\xbf\xac{g\xc5\xf0[c\xadBt\xdc\xcb\xe0\x9d\xec)\xe9\x989g"\x1c\x0b~+\x1eh\xcb\x101\xba$\x85\xd6\xed\x03\xda\xfa\xd3\x16\x03\xf5\xa5\xd0\xb8[\x19\xb9\xc2\x8f\xc4\xd0_\xfe\x00I9\x01\x00\x00\x00\x00',
 'status': 'confirmed',
 'verified': True,
 'witness_type': 'segwit',
 'change': 0}

I tried leaving a comment on my previously closed issue, but no response, so posting as a new issue. Also, noticed the same behavior on blocksmurfer, so I assume this is known?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions