spesmilo / electrumx

Alternative implementation of spesmilo/electrum-server
MIT License
441 stars 353 forks source link

How to get (Bitcoin) witness data from Tx object? The "witness" field does not get set for SegWit transactions #207

Closed ghost closed 1 year ago

ghost commented 1 year ago

It appears like the witness data is not populated in the deserialization of a Bitcoin transaction. I would like to inspect the witness data at this point: https://github.com/spesmilo/electrumx/blob/master/electrumx/server/block_processor.py#L447

However it seems like the default Bitcoin serializer does not retrieve the witness data for the transaction? The part that I'm missing is how is the marker parsed/ignored for SegWit transactions if it's not parsed?

Any help in getting the witness data for a transaction/input is greatly appreciated!

ghost commented 1 year ago

Solved, it does appear to be populated after all!