def on_handshake_complete(self): print "Connected to peer %s:%s" % (self.transport.getPeer().host, self.transport.getPeer().port) self.state = State.CONNECTED self.send_message(message(filer_load(str(self.bloom_filter.vData).encode("hex"), self.bloom_filter.nHashFuncs, self.bloom_filter.nTweak, self.bloom_filter.nFlags), self.params))
def update_filter(self): self.send_message(message(filer_load(str(self.bloom_filter.vData).encode("hex"), self.bloom_filter.nHashFuncs, self.bloom_filter.nTweak, self.bloom_filter.nFlags), self.params))