From 3babbcb48786372d4b22171674c4cc5a6220c294 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sat, 17 Jun 2017 00:18:42 +0000 Subject: Remove confusing MAX_BLOCK_BASE_SIZE. Some people keep thinking that MAX_BLOCK_BASE_SIZE is a separate size limit from the weight limit when it fact it is superfluous, and used in early tests before the witness data has been validated or just to compute worst case sizes. The size checks that use it would not behave any differently consensus wise if they were eliminated completely. Its correct value is not independently settable but is a function of the weight limit and weight formula. This patch just eliminates it and uses the scale factor as required to compute the worse case constants. It also moves the weight factor out of primitives into consensus, which is a more logical place for it. --- src/merkleblock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/merkleblock.cpp') diff --git a/src/merkleblock.cpp b/src/merkleblock.cpp index 78d7cd6001..ba5f7b400c 100644 --- a/src/merkleblock.cpp +++ b/src/merkleblock.cpp @@ -153,7 +153,7 @@ uint256 CPartialMerkleTree::ExtractMatches(std::vector &vMatch, std::ve if (nTransactions == 0) return uint256(); // check for excessively high numbers of transactions - if (nTransactions > MAX_BLOCK_BASE_SIZE / 60) // 60 is the lower bound for the size of a serialized CTransaction + if (nTransactions > MAX_BLOCK_WEIGHT / MIN_TRANSACTION_WEIGHT) return uint256(); // there can never be more hashes provided than one for every txid if (vHash.size() > nTransactions) -- cgit v1.2.3