mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Rename "block cost" to "block weight"
This commit is contained in:
@@ -32,11 +32,11 @@ std::string CBlock::ToString() const
|
||||
return s.str();
|
||||
}
|
||||
|
||||
int64_t GetBlockCost(const CBlock& block)
|
||||
int64_t GetBlockWeight(const CBlock& block)
|
||||
{
|
||||
// This implements the cost = (stripped_size * 4) + witness_size formula,
|
||||
// This implements the weight = (stripped_size * 4) + witness_size formula,
|
||||
// using only serialization with and without witness data. As witness_size
|
||||
// is equal to total_size - stripped_size, this formula is identical to:
|
||||
// cost = (stripped_size * 3) + total_size.
|
||||
// weight = (stripped_size * 3) + total_size.
|
||||
return ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user