mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
Rename "block cost" to "block weight"
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -694,8 +694,8 @@ bool AddOrphanTx(const CTransaction& tx, NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(c
|
||||
// have been mined or received.
|
||||
// 100 orphans, each of which is at most 99,999 bytes big is
|
||||
// at most 10 megabytes of orphans and somewhat more byprev index (in the worst case):
|
||||
unsigned int sz = GetTransactionCost(tx);
|
||||
if (sz >= MAX_STANDARD_TX_COST)
|
||||
unsigned int sz = GetTransactionWeight(tx);
|
||||
if (sz >= MAX_STANDARD_TX_WEIGHT)
|
||||
{
|
||||
LogPrint("mempool", "ignoring large orphan tx (size: %u, hash: %s)\n", sz, hash.ToString());
|
||||
return false;
|
||||
@@ -3596,13 +3596,13 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
|
||||
}
|
||||
|
||||
// After the coinbase witness nonce and commitment are verified,
|
||||
// we can check if the block cost passes (before we've checked the
|
||||
// coinbase witness, it would be possible for the cost to be too
|
||||
// we can check if the block weight passes (before we've checked the
|
||||
// coinbase witness, it would be possible for the weight to be too
|
||||
// large by filling up the coinbase witness, which doesn't change
|
||||
// the block hash, so we couldn't mark the block as permanently
|
||||
// failed).
|
||||
if (GetBlockCost(block) > MAX_BLOCK_COST) {
|
||||
return state.DoS(100, error("ContextualCheckBlock(): cost limit failed"), REJECT_INVALID, "bad-blk-cost");
|
||||
if (GetBlockWeight(block) > MAX_BLOCK_WEIGHT) {
|
||||
return state.DoS(100, error("ContextualCheckBlock(): weight limit failed"), REJECT_INVALID, "bad-blk-weight");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user