Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 678 Lines • ▼ Show 20 Lines | for (const CTxIn &txin : tx.vin) { | ||||
fSpendsCoinbase = true; | fSpendsCoinbase = true; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
CTxMemPoolEntry entry(ptx, nFees, nAcceptTime, chainActive.Height(), | CTxMemPoolEntry entry(ptx, nFees, nAcceptTime, chainActive.Height(), | ||||
fSpendsCoinbase, nSigOpsCount, lp); | fSpendsCoinbase, nSigOpsCount, lp); | ||||
unsigned int nSize = entry.GetTxSize(); | unsigned int nSize = entry.GetTxSize(); | ||||
unsigned int nVirtualSize = entry.GetTxVirtualSize(); | // Calculate virtual size for this tx in isolation. | ||||
// In principle we could update the ancestor info of the entry and | |||||
// use GetIncrementalVirtualSize which may be smaller, however this | |||||
// would create some odd 'parent pays for child' situations in times | |||||
// of mempool congestion. | |||||
unsigned int nVirtualSize = | |||||
GetVirtualTransactionSize(nSize, nSigOpsCount); | |||||
// Check that the transaction doesn't have an excessive number of | // Check that the transaction doesn't have an excessive number of | ||||
// sigops, making it impossible to mine. Since the coinbase transaction | // sigops, making it impossible to mine. Since the coinbase transaction | ||||
// itself can contain sigops MAX_STANDARD_TX_SIGOPS is less than | // itself can contain sigops MAX_STANDARD_TX_SIGOPS is less than | ||||
// MAX_BLOCK_SIGOPS_PER_MB; we still consider this an invalid rather | // MAX_BLOCK_SIGOPS_PER_MB; we still consider this an invalid rather | ||||
// than merely non-standard transaction. | // than merely non-standard transaction. | ||||
if (nSigOpsCount > MAX_STANDARD_TX_SIGOPS) { | if (nSigOpsCount > MAX_STANDARD_TX_SIGOPS) { | ||||
return state.DoS(0, false, REJECT_NONSTANDARD, | return state.DoS(0, false, REJECT_NONSTANDARD, | ||||
▲ Show 20 Lines • Show All 4,991 Lines • Show Last 20 Lines |