Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 378 Lines • ▼ Show 20 Lines | if (useExistingLockPoints) { | ||||
} | } | ||||
} | } | ||||
return EvaluateSequenceLocks(index, lockPair); | return EvaluateSequenceLocks(index, lockPair); | ||||
} | } | ||||
uint64_t GetSigOpCountWithoutP2SH(const CTransaction &tx, uint32_t flags) { | uint64_t GetSigOpCountWithoutP2SH(const CTransaction &tx, uint32_t flags) { | ||||
uint64_t nSigOps = 0; | uint64_t nSigOps = 0; | ||||
for (const auto &txin : tx.vin) { | for (const auto &txin : tx.vin) { | ||||
nSigOps += txin.scriptSig.GetSigOpCount(false); | nSigOps += txin.scriptSig.GetSigOpCount(flags, false); | ||||
} | } | ||||
for (const auto &txout : tx.vout) { | for (const auto &txout : tx.vout) { | ||||
nSigOps += txout.scriptPubKey.GetSigOpCount(false); | nSigOps += txout.scriptPubKey.GetSigOpCount(flags, false); | ||||
} | } | ||||
return nSigOps; | return nSigOps; | ||||
} | } | ||||
uint64_t GetP2SHSigOpCount(const CTransaction &tx, const CCoinsViewCache &view, | uint64_t GetP2SHSigOpCount(const CTransaction &tx, const CCoinsViewCache &view, | ||||
uint32_t flags) { | uint32_t flags) { | ||||
if ((flags & SCRIPT_VERIFY_P2SH) == 0 || tx.IsCoinBase()) { | if ((flags & SCRIPT_VERIFY_P2SH) == 0 || tx.IsCoinBase()) { | ||||
return 0; | return 0; | ||||
} | } | ||||
uint64_t nSigOps = 0; | uint64_t nSigOps = 0; | ||||
for (auto &i : tx.vin) { | for (auto &i : tx.vin) { | ||||
const CTxOut &prevout = view.GetOutputFor(i); | const CTxOut &prevout = view.GetOutputFor(i); | ||||
if (prevout.scriptPubKey.IsPayToScriptHash()) { | if (prevout.scriptPubKey.IsPayToScriptHash()) { | ||||
nSigOps += prevout.scriptPubKey.GetSigOpCount(i.scriptSig); | nSigOps += prevout.scriptPubKey.GetSigOpCount(flags, i.scriptSig); | ||||
} | } | ||||
} | } | ||||
return nSigOps; | return nSigOps; | ||||
} | } | ||||
uint64_t GetTransactionSigOpCount(const CTransaction &tx, | uint64_t GetTransactionSigOpCount(const CTransaction &tx, | ||||
const CCoinsViewCache &view, uint32_t flags) { | const CCoinsViewCache &view, uint32_t flags) { | ||||
▲ Show 20 Lines • Show All 5,128 Lines • Show Last 20 Lines |