mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
test: remove bare CTransaction .rehash()/.calc_sha256() calls
Since the previous commit, CTransaction object calls to the methods `.rehash()` and `.calc_sha256()` are effectively no-ops if the returned value is not used, so we can just remove them.
This commit is contained in:
@@ -682,7 +682,6 @@ class CTransaction:
|
||||
return uint256_from_str(hash256(self.serialize_with_witness()))
|
||||
|
||||
def is_valid(self):
|
||||
self.calc_sha256()
|
||||
for tout in self.vout:
|
||||
if tout.nValue < 0 or tout.nValue > 21000000 * COIN:
|
||||
return False
|
||||
@@ -810,7 +809,6 @@ class CBlock(CBlockHeader):
|
||||
def calc_merkle_root(self):
|
||||
hashes = []
|
||||
for tx in self.vtx:
|
||||
tx.calc_sha256()
|
||||
hashes.append(ser_uint256(tx.sha256))
|
||||
return self.get_merkle_root(hashes)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user