def _build_message(self, message):
    'Build a serialized P2P message'
    command = message.command
    data = message.serialize()
    tmsg = MAGIC_BYTES[self.network]
    tmsg += command
    tmsg += (b'\x00' * (12 - len(command)))
    tmsg += struct.pack('<I', len(data))
    th = sha256(data)
    h = sha256(th)
    tmsg += h[:4]
    tmsg += data
    return tmsg
Build a serialized P2P message
def _build_message(self, message):
    
    command = message.command
    data = message.serialize()
    tmsg = MAGIC_BYTES[self.network]
    tmsg += command
    tmsg += (b'\x00' * (12 - len(command)))
    tmsg += struct.pack('<I', len(data))
    th = sha256(data)
    h = sha256(th)
    tmsg += h[:4]
    tmsg += data
    return tmsg