bcli: return "not found" on any getblockhash exit status

Return "not found" on any `getblockhash` exit status. Previously, only exit code 8 (block height doesn't exist) returned "not found", while other exit codes returned an error. Now any non-zero exit status returns "not found" since any failure means the block is unavailable.
This commit is contained in:
dovgopoly
2026-01-13 23:02:52 +02:00
committed by Sangbida
parent 57d60c025b
commit d727946b14

View File

@@ -344,10 +344,7 @@ static struct command_result *getrawblockbyheight(struct command *cmd,
tal_fmt(tmpctx, "%u", *height), NULL);
if (res->exitstatus != 0) {
/* Exit code 8 means block height doesn't exist (empty response) */
if (res->exitstatus == 8)
return getrawblockbyheight_notfound(cmd);
return command_err(cmd, res, "command failed");
return getrawblockbyheight_notfound(cmd);
}
strip_trailing_whitespace(res->output, res->output_len);