Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/messages.py
Show First 20 Lines • Show All 488 Lines • ▼ Show 20 Lines | class CTransaction: | ||||
def get_id(self): | def get_id(self): | ||||
# For now, just forward the hash. | # For now, just forward the hash. | ||||
self.calc_sha256() | self.calc_sha256() | ||||
return self.hash | return self.hash | ||||
def is_valid(self): | def is_valid(self): | ||||
self.calc_sha256() | self.calc_sha256() | ||||
for tout in self.vout: | for tout in self.vout: | ||||
if tout.nValue < 0 or tout.nValue > 21000000 * COIN: | if tout.nValue < 0 or tout.nValue > MAX_MONEY: | ||||
return False | return False | ||||
return True | return True | ||||
def __repr__(self): | def __repr__(self): | ||||
return "CTransaction(nVersion={} vin={} vout={} nLockTime={})".format( | return "CTransaction(nVersion={} vin={} vout={} nLockTime={})".format( | ||||
self.nVersion, repr(self.vin), repr(self.vout), self.nLockTime) | self.nVersion, repr(self.vin), repr(self.vout), self.nLockTime) | ||||
▲ Show 20 Lines • Show All 1,584 Lines • Show Last 20 Lines |