def get(self, hash_and_pc, rtx): res = self.txos.get_by_hash(sha256(hash_and_pc), rtx=rtx) if not res: raise KeyError(hash_and_pc) utxo = IOput() utxo.deserialize_with_context(res) utxo.set_verified_and_correct() #Trust saved outputs return utxo
def find(self, hash_and_pc, rtx): ''' In contrast with __getitem__ find will try to find even spent outputs for other (syncing) nodes. ''' res = self.txos.find_by_hash(sha256(hash_and_pc), rtx=rtx) if not res: raise KeyError(hash_and_pc) utxo = IOput() utxo.deserialize_with_context(res) utxo.set_verified_and_correct() #Trust saved outputs return utxo