ethers / bitcoin-proof

Merkle proof for a Bitcoin transaction
MIT License
32 stars 7 forks source link

getTxMerkle arguments #1

Closed fanatid closed 8 years ago

fanatid commented 8 years ago

For what purpose getTxMerkle require transaction hash as first argument? Transaction hash available in proof obj.

ethers commented 8 years ago

Thanks for the feedback. Agree there's some redundancy. IIRC the proofObj returned by getProof previously didn't have the transactionHash (txHash), since the API before was getProof(transactions, transactionHash).

So getTxMerkle doesn't use the txHash in proofObj. Now getTxMerkle(transactionHash, proofObj) is simpler than getTxMerkle(transactionHash, merkleSiblings, transactionIndex). So I think the redundancy is ok since it makes getTxMerkle clearer.

fanatid commented 8 years ago

Don't you mind if I shall create PR with changes? Also I would add semistandard as linter.

ethers commented 8 years ago

Sure, we can discuss PR with your changes. semistandard looks good. Thanks