|
|
@ -126,7 +126,7 @@ unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& in |
|
|
|
unsigned int nSigOps = 0; |
|
|
|
unsigned int nSigOps = 0; |
|
|
|
for (unsigned int i = 0; i < tx.vin.size(); i++) |
|
|
|
for (unsigned int i = 0; i < tx.vin.size(); i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const CTxOut &prevout = inputs.GetOutputFor(tx.vin[i]); |
|
|
|
const CTxOut &prevout = inputs.AccessCoin(tx.vin[i].prevout).out; |
|
|
|
if (prevout.scriptPubKey.IsPayToScriptHash()) |
|
|
|
if (prevout.scriptPubKey.IsPayToScriptHash()) |
|
|
|
nSigOps += prevout.scriptPubKey.GetSigOpCount(tx.vin[i].scriptSig); |
|
|
|
nSigOps += prevout.scriptPubKey.GetSigOpCount(tx.vin[i].scriptSig); |
|
|
|
} |
|
|
|
} |
|
|
@ -146,7 +146,7 @@ int64_t GetTransactionSigOpCost(const CTransaction& tx, const CCoinsViewCache& i |
|
|
|
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < tx.vin.size(); i++) |
|
|
|
for (unsigned int i = 0; i < tx.vin.size(); i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const CTxOut &prevout = inputs.GetOutputFor(tx.vin[i]); |
|
|
|
const CTxOut &prevout = inputs.AccessCoin(tx.vin[i].prevout).out; |
|
|
|
nSigOps += CountWitnessSigOps(tx.vin[i].scriptSig, prevout.scriptPubKey, &tx.vin[i].scriptWitness, flags); |
|
|
|
nSigOps += CountWitnessSigOps(tx.vin[i].scriptSig, prevout.scriptPubKey, &tx.vin[i].scriptWitness, flags); |
|
|
|
} |
|
|
|
} |
|
|
|
return nSigOps; |
|
|
|
return nSigOps; |
|
|
|