Example #1
0
def filterload(self, flag=1):
    payload = encode_varint(self.size)
    payload += self.filter_bytes()
    payload += int_to_little_endian(self.function_count, 4)
    payload += int_to_little_endian(self.tweak, 4)
    payload += int_to_little_endian(flag, 1)
    return GenericMessage(b'filterload', payload)
Example #2
0
 def filterload(self, flag=1):
     payload = encode_varint(self.size)
     payload += bit_field_to_bytes(self.bit_field)
     payload += int_to_little_endian(self.function_count, 4)
     payload += int_to_little_endian(self.tweak, 4)
     # The matched item flag is used to tell the full node to add any matched transactions to the bloom filter.
     payload += int_to_little_endian(flag, 1)
     # filterload is the command used to set the bloom filter.
     return GenericMessage(b'filterload', payload)
Example #3
0
def filterload(self, flag=1):
    # encode_varint self.size
    payload = encode_varint(self.size)
    # next is the self.filter_bytes()
    payload += self.filter_bytes()
    # function count is 4 bytes little endian
    payload += int_to_little_endian(self.function_count, 4)
    # tweak is 4 bytes little endian
    payload += int_to_little_endian(self.tweak, 4)
    # flag is 1 byte little endian
    payload += int_to_little_endian(flag, 1)
    return GenericMessage(b'filterload', payload)
Example #4
0
 def filterload(self, flag=1):
     '''Return a network message whose command is filterload'''
     # encode_varint self.size
     payload = encode_varint(self.size)
     # next is the self.filter_bytes()
     payload += self.filter_bytes()
     # function count is 4 bytes little endian
     payload += int_to_little_endian(self.function_count, 4)
     # tweak is 4 bytes little endian
     payload += int_to_little_endian(self.tweak, 4)
     # flag is 1 byte little endian
     payload += int_to_little_endian(flag, 1)
     # return a GenericMessage with b'filterload' as the command
     return GenericMessage(b'filterload', payload)
Example #5
0
 def filterload(self, flag=1):
     '''Return the filterload message'''
     # start the payload with the size of the filter in bytes
     payload = encode_varint(self.size)
     # next add the bit field using self.filter_bytes()
     payload += self.filter_bytes()
     # function count is 4 bytes little endian
     payload += int_to_little_endian(self.function_count, 4)
     # tweak is 4 bytes little endian
     payload += int_to_little_endian(self.tweak, 4)
     # flag is 1 byte little endian
     payload += int_to_little_endian(flag, 1)
     # return a GenericMessage whose command is b'filterload'
     # and payload is what we've calculated
     return GenericMessage(b'filterload', payload)