Closed RyanZim closed 6 years ago
@RyanZim getHash
provides the cryptographic hash as used in parts of the code (signing, etc).
You want the reverse-byte order transaction id, using getId
.
This is what is used by block explorers and most GUIs.
It is confusing.
Quick way to see this, is by the looking at what you provided:
8d e6 46 1ef98236992d567b21f608123b4d4243bb025242cbf42ee3f29aceb2f9
-------------------------------------------------------->
f9b2ce9af2e32ef4cb425202bb43424d3b1208f6217b562d993682f91e 46 e6 8d
OK, thanks! My bad for just assuming that's what getHash
did.
My bad for just assuming that's what getHash did.
It wasn't a bad assumption! I banged my head against a wall for a long time trying to think of a way out of this hell. Let me know if you have any ideas on how we could make it clearer.
Is getHash
intended for use by end users? If not, rename it to _getHash
. If you want it external, how about getHash256
or getDoubleSha256
?
@RyanZim it is used externally for many modules too, especially if dealing with custom transaction creation etc.
how about getHash256 or getDoubleSha256?
getDoubleSha256
isn't too bad, getHash256
I dont think would help any.
If I do:
(runkit) I get:
This actual transaction is on the blockchain with a transaction ID of:
You can verify this with https://blockchain.info/decode-tx
What's wrong?