You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transactions can originate from the P2P network, the wallet, RPCs or from tests.
11
10
12
11
Transactions which originate from the wallet, RPCs or individually from the P2P network (from a `NetMsgType::TX` message) will follow a validation pathway which includes adding them to the mempool.
@@ -14,7 +15,6 @@ Transactions learned about from blocks:
14
15
This means that we can validate these transactions based only on our copy of the UTXO set and the data contained within the block itself.
15
16
We call `ProcessBlock()` when processing new blocks received from the P2P network (in _net_processing.cpp_) from net message types: `NetMsgType::CMPCTBLOCK`, `NetMsgType::BLOCKTXN` and `NetMsgType::BLOCK`.
@@ -86,7 +86,6 @@ In these cases this block may still be useful to us in the future.
86
86
87
87
Once the block has been written to disk by `AcceptBlock()` full validation of the block and its transactions begins via `CChainState::ActivateBestChain()` and its inner call to `ActivateBestChainStep()`.
88
88
89
-
////
90
89
As part of `ProcessBlock()` we end up calling `CheckBlock()` twice: once on the inner `ProcessNewBlock()` and, if this first is successful, once again inside of `AcceptBlock()`.
91
90
We find the following code comment inside `ProcessBlock()`:
92
91
@@ -128,7 +127,6 @@ Therefore we call `CheckBlock()` first, and only try `AcceptBlock()` if this pas
128
127
129
128
Note here how the developers have had to balance consideration for sensitive validation code, staying in consensus with the rest of the network and avoiding potential P2P DoS attacks.
130
129
This type of thinking is common across the codebase.
131
-
////
132
130
133
131
////
134
132
TODO: Note that the primary validation occurs inside `ConnectBlock()`, not `CheckBlock()` and `AcceptBlock()`
0 commit comments