PyBitmessage-2021-04-27/src/protocol.py
mailchuck 249fac638d
Addresses can be configured not to send acks
Manually by specifying "dontsendack" = true in the address section
2015-12-15 20:31:15 +01:00

14 lines
426 B
Python

import struct
import shared
def getBitfield(address):
# bitfield of features supported by me (see the wiki).
bitfield = 0
# send ack
if not shared.safeConfigGetBoolean(address, 'dontsendack'):
bitfield |= shared.BITFIELD_DOESACK
return struct.pack('>I', bitfield)
def checkBitfield(bitfieldBinary, flags):
bitfield, = struct.unpack('>I', bitfieldBinary)
return (bitfield & flags) == flags