bitcoin/src/consensus
Suhas Daftuar ed6cddd98e Require callers of AcceptBlockHeader() to perform anti-dos checks
In order to prevent memory DoS, we must ensure that we don't accept a new
header into memory until we've performed anti-DoS checks, such as verifying
that the header is part of a sufficiently high work chain. This commit adds a
new argument to AcceptBlockHeader() so that we can ensure that all call-sites
which might cause a new header to be accepted into memory have to grapple with
the question of whether the header is safe to accept, or needs further
validation.

This patch also fixes two places where low-difficulty-headers could have been
processed without such validation (processing an unrequested block from the
network, and processing a compact block).

Credit to Niklas Gögge for noticing this issue, and thanks to Sjors Provoost
for test code.
2022-08-29 08:10:35 -04:00
..
amount.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
consensus.h Remove LOCKTIME_MEDIAN_TIME_PAST constant 2022-06-22 09:54:15 +02:00
merkle.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
merkle.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
params.h Add time helpers 2022-08-05 14:45:02 +02:00
tx_check.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
tx_check.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
tx_verify.cpp Sanity assert GetAncestor() != nullptr where appropriate 2022-05-05 15:55:44 +02:00
tx_verify.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
validation.h Require callers of AcceptBlockHeader() to perform anti-dos checks 2022-08-29 08:10:35 -04:00