Naturally one might assume that all code related to consensus could be found in the src/consensus/ directory, however this is not entirely the case. Components of consensus-related code can be found across the Bitcoin Core codebase in a number of files, including but not limited to:
📂 bitcoin
📂 src
📂 consensus
📂 script
📄interpreter.cpp
📄 validation.h
📄 validation.cpp
Consensus-critical functions can also be found in proximity to code which could affect whether a node considers a transaction or block valid. This could extend to, for example, block storage database code.
An abbreviated list of some of the more notable consensus functions and variables is shown below.
File | Objects |
---|---|
src/consensus/amount.h |
|
src/consensus/consensus.h |
|
src/consensus/merkle.{h|cpp} |
|
src/consensus/params.h |
|
src/consensus/tx_check.{h|cpp} |
|
src/consensus/tx_verify.{h|cpp} |
|
src/consensus/validation.h |
|