fixing overidentification of p2ms by moving the case statement below p2wpkh, p2wsh, p2tr. #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
segwit scripts end in hashes that may end in
xAE
which is misinterpreted asOP_CHECKSIG
. script type is reported as p2ms in these cases.example: ed35633eaa28f4452c4eb1b45df9f9667878f23e05a40116660bec381a000000 vout: 3
fix is simple enough: move the case statement below the segwit script types.
I also tweaked the README a bit, I hope it adds value.
before my change:
$ ./bitcoin-utxo-dump -db ~/scratch/bitcoin/node-data-copy/chainstate -f txid,vout,height,amount,script,type ... Total UTXOs: 83310739 Total BTC: 19266337.75311853 Script Types: p2tr 318515 non-standard 9565 p2pk 47584 p2pkh 47777074 p2sh 15252482 p2ms 516634 p2wpkh 18273276 p2wsh 1115609
after my change:
$ ./bitcoin-utxo-dump -db ~/scratch/bitcoin/node-data-copy/chainstate -f txid,vout,height,amount,script,type ... Total UTXOs: 83310739 Total BTC: 19266337.75311853 Script Types: non-standard 9565 p2pk 47584 p2pkh 47777074 p2sh 15252482 p2ms 440424 p2wpkh 18343108 p2wsh 1120662 p2tr 319840
difference: