return rpc error instead of continuing when ledger header isn't read

This commit is contained in:
Richard Holland
2025-04-01 13:04:45 +11:00
parent 0e19a4034d
commit 7e8436cb50

View File

@@ -987,9 +987,11 @@ doCatalogueLoad(RPC::JsonContext& context)
reinterpret_cast<char*>(&parentCloseTime),
sizeof(parentCloseTime)))
{
JLOG(context.j.warn()) << "Catalogue load expected but could not "
"read the next ledger header.";
break;
JLOG(context.j.warn())
<< "Catalogue load expected but could not "
<< "read the next ledger header at seq=" << expected_seq << ". "
<< "Ledgers prior to this in the file (if any) were loaded.";
return rpcError(rpcINTERNAL, "Unexpected end of catalogue file.");
}
info.closeTime = time_point{duration{closeTime}};