setavenger / blindbit-oracle

A GO implementation for a BIP0352 Silent Payments Indexing Server
6 stars 6 forks source link

bug fix: fix byte order for block hash #11

Closed cygnet3 closed 3 months ago

cygnet3 commented 3 months ago

Just like the txid, the block hash bytes should be reversed after they are read from a hex string.

setavenger commented 3 months ago

good point. Thanks!

setavenger commented 3 months ago

@cygnet3 wait a minute, this will probably revert the bytes on every iteration flipping from BE to LE and back to BE encoding on every iteration. Will revert.

cygnet3 commented 3 months ago

I see my bad, I'll make a new PR

setavenger commented 3 months ago

I suggest using something like this https://github.com/setavenger/go-bip352/blob/master/util.go#L43 for now. I will integrate go-bip352 at some point but until then we can just do a quick helper function.