Changeset View
Changeset View
Standalone View
Standalone View
src/rest.cpp
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | switch (rf) { | ||||
std::string strHex = | std::string strHex = | ||||
HexStr(ssHeader.begin(), ssHeader.end()) + "\n"; | HexStr(ssHeader.begin(), ssHeader.end()) + "\n"; | ||||
req->WriteHeader("Content-Type", "text/plain"); | req->WriteHeader("Content-Type", "text/plain"); | ||||
req->WriteReply(HTTP_OK, strHex); | req->WriteReply(HTTP_OK, strHex); | ||||
return true; | return true; | ||||
} | } | ||||
case RetFormat::JSON: { | case RetFormat::JSON: { | ||||
UniValue jsonHeaders(UniValue::VARR); | UniValue jsonHeaders(UniValue::VARR); | ||||
markblundeberg: leave out this change | |||||
for (const CBlockIndex *pindex : headers) { | for (const CBlockIndex *pindex : headers) { | ||||
jsonHeaders.push_back(blockheaderToJSON(tip, pindex)); | jsonHeaders.push_back(blockheaderToJSON(tip, pindex)); | ||||
} | } | ||||
std::string strJSON = jsonHeaders.write() + "\n"; | std::string strJSON = jsonHeaders.write() + "\n"; | ||||
req->WriteHeader("Content-Type", "application/json"); | req->WriteHeader("Content-Type", "application/json"); | ||||
req->WriteReply(HTTP_OK, strJSON); | req->WriteReply(HTTP_OK, strJSON); | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 496 Lines • Show Last 20 Lines |
leave out this change