MCPcopy Index your code
hub / github.com/jimmysong/programmingbitcoin / verify

Method verify

code-ch08/tx.py:221–230  ·  view source on GitHub ↗

Verify this transaction

(self)

Source from the content-addressed store, hash-verified

219 return combined.evaluate(z)
220
221 def verify(self):
222 '''Verify this transaction'''
223 # check that we're not creating money
224 if self.fee() < 0:
225 return False
226 # check that each input has a valid ScriptSig
227 for i in range(len(self.tx_ins)):
228 if not self.verify_input(i):
229 return False
230 return True
231
232 def sign_input(self, input_index, private_key):
233 '''Signs the input using the private key'''

Callers 4

op_checksigFunction · 0.45
test_verify_p2pkhMethod · 0.45
test_verify_p2shMethod · 0.45
op_checkmultisigFunction · 0.45

Calls 2

feeMethod · 0.95
verify_inputMethod · 0.95

Tested by 2

test_verify_p2pkhMethod · 0.36
test_verify_p2shMethod · 0.36