def on_inv(self, message):
    for x in self.last_message['inv'].inv:
        if (x.type == 2):
            self.block_announced = True
            self.announced_blockhashes.add(x.hash)
def on_inv(self, message):
    for x in self.last_message['inv'].inv:
        if (x.type == 2):
            self.block_announced = True
            self.announced_blockhashes.add(x.hash)