Transaction and block version are signed integers#106
Transaction and block version are signed integers#106gabegattis merged 1 commit intobitpay:masterfrom
Conversation
|
Merge please? |
|
The Bitcoin wiki isn't the Bitcoin protocol's specification. Nonetheless, @afk11 is correct based on Bitcoin Core's source to date. Please see: https://github.com/bitcoin/bitcoin/blob/master/src/primitives/block.h#L24 'int32_t' is type defined to 'int' in coda.h in the Linux kernel header files. I think it is safe to assume that the other supported platforms that Bitcoin actively supports with also yield int32_t to a 4 byte length and handle the signed magnitude encoding correctly given the compiler used. This is probably a breaking api change, but if you have a counter argument as to why it is not, please reply. |
|
I'm going to pull down the code and do a proper review later today. I think we can get probably get this pulled in by tomorrow. |
|
Removing the api change label. @gabegattis and I don't think this will break the api in any way. |
|
👍 |
|
Thanks @afk11 |
https://en.bitcoin.it/wiki/Protocol_documentation#Block_Headers
https://en.bitcoin.it/wiki/Protocol_documentation#tx
The transaction and block version fields are both int32's (little endian encoded), so technically the range is -2^31 to 2^31 (not zero to 2^32)