Open Kagami opened 9 years ago
>>> from struct import *
>>> pack('>q',1)
'\x00\x00\x00\x00\x00\x00\x00\x01'
It appears to me that shared.py#L149 is MSB 0.
Hm, you are right. I misread value 1 in
Value Name Description 1 NODE_NETWORK This is a normal network node.
as a bit number. But it's still not very clear because pubkey bitfield uses bits and services bitfield uses BE values.
You are right that that is strange. The services bitfield I copied from Bitcoin because it seemed like a good idea but we don't make use of it yet and it appears that neither does Bitcoin.
Hi. Another spec quirk.
Service features bitfield uses LSB 0: https://github.com/Bitmessage/PyBitmessage/blob/master/src/shared.py#L149 https://bitmessage.org/wiki/Protocol_specification#version
At the same time pubkey behavior bitfield uses MSB 0: https://github.com/Bitmessage/PyBitmessage/blob/master/src/class_singleWorker.py#L272 https://bitmessage.org/wiki/Protocol_specification#Pubkey_bitfield_features https://github.com/Bitmessage/PyBitmessage/blob/master/src/class_singleWorker.py#L747 https://github.com/Bitmessage/PyBitmessage/blob/master/src/shared.py#L469
Should we be more consistent or at least mention this contradiction in the wiki?