def METHOD_NAME(self, tx):
    tx.calc_sha256()
    try:
        self.txDB[repr(tx.sha256)] = bytes(tx.serialize())
    except TypeError as e:
        print("Unexpected error: ", sys.exc_info()[0], e.args)