Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/script.py
Show First 20 Lines • Show All 680 Lines • ▼ Show 20 Lines | def SignatureHash(script, txTo, inIdx, hashtype): | ||||
elif (hashtype & 0x1f) == SIGHASH_SINGLE: | elif (hashtype & 0x1f) == SIGHASH_SINGLE: | ||||
outIdx = inIdx | outIdx = inIdx | ||||
if outIdx >= len(txtmp.vout): | if outIdx >= len(txtmp.vout): | ||||
return (HASH_ONE, "outIdx {} out of range ({})".format( | return (HASH_ONE, "outIdx {} out of range ({})".format( | ||||
outIdx, len(txtmp.vout))) | outIdx, len(txtmp.vout))) | ||||
tmp = txtmp.vout[outIdx] | tmp = txtmp.vout[outIdx] | ||||
txtmp.vout = [] | txtmp.vout = [] | ||||
for i in range(outIdx): | for _ in range(outIdx): | ||||
txtmp.vout.append(CTxOut(-1)) | txtmp.vout.append(CTxOut(-1)) | ||||
txtmp.vout.append(tmp) | txtmp.vout.append(tmp) | ||||
for i in range(len(txtmp.vin)): | for i in range(len(txtmp.vin)): | ||||
if i != inIdx: | if i != inIdx: | ||||
txtmp.vin[i].nSequence = 0 | txtmp.vin[i].nSequence = 0 | ||||
if hashtype & SIGHASH_ANYONECANPAY: | if hashtype & SIGHASH_ANYONECANPAY: | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |