Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 1,440 Lines • ▼ Show 20 Lines | for (const CBlockIndex *block : setTips) { | ||||
status = "active"; | status = "active"; | ||||
} else if (block->nStatus & BLOCK_FAILED_MASK) { | } else if (block->nStatus & BLOCK_FAILED_MASK) { | ||||
// This block or one of its ancestors is invalid. | // This block or one of its ancestors is invalid. | ||||
status = "invalid"; | status = "invalid"; | ||||
} else if (block->nChainTx == 0) { | } else if (block->nChainTx == 0) { | ||||
// This block cannot be connected because full block data for it or | // This block cannot be connected because full block data for it or | ||||
// one of its parents is missing. | // one of its parents is missing. | ||||
status = "headers-only"; | status = "headers-only"; | ||||
} else if (block->IsValid(BLOCK_VALID_SCRIPTS)) { | } else if (block->IsValid(BlockValidity::SCRIPTS)) { | ||||
// This block is fully validated, but no longer part of the active | // This block is fully validated, but no longer part of the active | ||||
// chain. It was probably the active block once, but was | // chain. It was probably the active block once, but was | ||||
// reorganized. | // reorganized. | ||||
status = "valid-fork"; | status = "valid-fork"; | ||||
} else if (block->IsValid(BLOCK_VALID_TREE)) { | } else if (block->IsValid(BlockValidity::TREE)) { | ||||
// The headers for this block are valid, but it has not been | // The headers for this block are valid, but it has not been | ||||
// validated. It was probably never part of the most-work chain. | // validated. It was probably never part of the most-work chain. | ||||
status = "valid-headers"; | status = "valid-headers"; | ||||
} else { | } else { | ||||
// No clue. | // No clue. | ||||
status = "unknown"; | status = "unknown"; | ||||
} | } | ||||
obj.push_back(Pair("status", status)); | obj.push_back(Pair("status", status)); | ||||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |