Skip to content

Commit abb7b01

Browse files
committed
Add some additional comments about BitcoindRPCCheck infra
1 parent 62c56f4 commit abb7b01

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/validation.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,6 +2212,13 @@ void ThreadScriptCheck() {
22122212
scriptcheckqueue.Thread();
22132213
}
22142214

2215+
/* This function has two major purposes:
2216+
* 1) Checks that the RPC connection to the parent chain node
2217+
* can be attained, and is returning back reasonable answers.
2218+
* 2) Re-evaluates a list of blocks that have been deemed "bad"
2219+
* from the perspective of peg-in witness validation. Blocks are
2220+
* added to this queue in ConnectTip based on the error code returned.
2221+
*/
22152222
bool BitcoindRPCCheck(const bool init)
22162223
{
22172224
//First, we can clear out any blocks thatsomehow are now deemed valid
@@ -3230,8 +3237,10 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
32303237
if (!rv) {
32313238
if (state.IsInvalid()) {
32323239
InvalidBlockFound(pindexNew, state);
3233-
//Possibly result of RPC to bitcoind failure
3234-
//or unseen Bitcoin blocks.
3240+
// Possibly result of RPC to bitcoind failure
3241+
// or unseen Bitcoin blocks.
3242+
// These blocks are later re-evaluated at an interval
3243+
// set by `-recheckpeginblockinterval`.
32353244
if (state.GetRejectCode() == REJECT_PEGIN) {
32363245
//Write queue of invalid blocks that
32373246
//must be cleared to continue operation

0 commit comments

Comments
 (0)