Skip to content

Commit f5b9b8f

Browse files
sdaftuarsipa
authored andcommitted
[qa] Fix bug in mininode witness deserialization
Also improve tx printing
1 parent 6aa28ab commit f5b9b8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

qa/rpc-tests/test_framework/mininode.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def deserialize(self, f):
452452
else:
453453
self.vout = deser_vector(f, CTxOut)
454454
if flags != 0:
455-
self.wit.vtxinwit = [CTxInWitness()]*len(self.vin)
455+
self.wit.vtxinwit = [CTxInWitness() for i in range(len(self.vin))]
456456
self.wit.deserialize(f)
457457
self.nLockTime = struct.unpack("<I", f.read(4))[0]
458458
self.sha256 = None
@@ -518,8 +518,8 @@ def is_valid(self):
518518
return True
519519

520520
def __repr__(self):
521-
return "CTransaction(nVersion=%i vin=%s vout=%s nLockTime=%i)" \
522-
% (self.nVersion, repr(self.vin), repr(self.vout), self.nLockTime)
521+
return "CTransaction(nVersion=%i vin=%s vout=%s wit=%s nLockTime=%i)" \
522+
% (self.nVersion, repr(self.vin), repr(self.vout), repr(self.wit), self.nLockTime)
523523

524524

525525
class CBlockHeader(object):

0 commit comments

Comments
 (0)