Add maximal amount-of-transactions limit to checkblock/CVerifyDB#8138
Add maximal amount-of-transactions limit to checkblock/CVerifyDB#8138jonasschnelli wants to merge 1 commit intobitcoin:masterfrom
Conversation
Or perhaps a limit specified in size on disk? Last 288MB as an example. |
| if (ShutdownRequested()) | ||
| return true; | ||
| nTxCheckLimitCurrent+=block.vtx.size(); | ||
| if (nTxCheckLimit > 0 && nTxCheckLimitCurrent >= nTxCheckLimit && chainActive.Height() - pindex->nHeight >= std::min(nCheckDepth, MIN_BLOCK_TO_RESPECT_WITH_MAX_TX_CHECK)) { |
There was a problem hiding this comment.
The std::min isn't necessary, as chainActive.Height() - pindex->nHeight will never exceed nCheckDepth (we bail out of the loop before that can happen).
|
The relationship between -checkblocks and -checkmaxtx is not clear from the help text. It looks like as implemented it will stop when either limit is reached, modulo the |
|
You could also just get rid of MIN_BLOCK_TO_RESPECT_WITH_MAX_TX_CHECK. The theoretical maximum number of transactions in a block is 16665 anyway, so 100000 transactions effectively already requires 7 blocks anyway. If someone wants to set a lower number of transactions, so bit it. That would simplify this PR, and have clearer semantics. |
|
Closing this as superseded by #8611. |
Reduces checkblocks default to 144 blocks (
MIN_BLOCKS_TO_KEEP / 2).Introduce
-checkmaxtxwith a default of100'000transaction to set a upper bound of amount of transaction to check during the CVerifyDB process.There is also a new constant
MIN_BLOCK_TO_RESPECT_WITH_MAX_TX_CHECKwhich defines the minimum amount of blocks to check even if the-checkmaxtxcheck has been fulfilled.