From c8842c20b6aa49b97cbc44b68b001e97ff439842 Mon Sep 17 00:00:00 2001 From: ismaelsadeeq Date: Wed, 27 Nov 2024 13:54:20 -0500 Subject: [PATCH] doc: explain why we substract 4000 from `DEFAULT_BLOCK_MAX_WEIGHT` --- src/policy/policy.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/policy/policy.h b/src/policy/policy.h index 0488f8dbee86cb..0aa6bfb8ab3eb1 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -19,7 +19,9 @@ class CCoinsViewCache; class CFeeRate; class CScript; -/** Default for -blockmaxweight, which controls the range of block weights the mining code will create **/ +/** Default value for -blockmaxweight, which controls the range of block weights the mining code will create. + * The 4000 weight units subtracted are reserved for the miner's coinbase transaction weight. +**/ static constexpr unsigned int DEFAULT_BLOCK_MAX_WEIGHT{MAX_BLOCK_WEIGHT - 4000}; /** Default for -blockmintxfee, which sets the minimum feerate for a transaction in blocks created by mining code **/ static constexpr unsigned int DEFAULT_BLOCK_MIN_TX_FEE{1000};