validation: Add and use HaveTxsDownloaded where appropriate

This commit is contained in:
MarcoFalke
2018-12-03 18:14:08 -05:00
parent ed12fd83ca
commit fa4fc8856b
4 changed files with 24 additions and 15 deletions

View File

@@ -1458,7 +1458,7 @@ static UniValue getchaintips(const JSONRPCRequest& request)
} else if (block->nStatus & BLOCK_FAILED_MASK) {
// This block or one of its ancestors is invalid.
status = "invalid";
} else if (block->nChainTx == 0) {
} else if (!block->HaveTxsDownloaded()) {
// This block cannot be connected because full block data for it or one of its parents is missing.
status = "headers-only";
} else if (block->IsValid(BLOCK_VALID_SCRIPTS)) {