Changeset View
Changeset View
Standalone View
Standalone View
src/rest.cpp
Show First 20 Lines • Show All 265 Lines • ▼ Show 20 Lines | switch (rf) { | ||||
req->WriteReply(HTTP_OK, strHex); | req->WriteReply(HTTP_OK, strHex); | ||||
return true; | return true; | ||||
} | } | ||||
case RetFormat::JSON: { | case RetFormat::JSON: { | ||||
UniValue objBlock; | UniValue objBlock; | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
objBlock = | objBlock = blockToJSON(block, pblockindex, showTxDetails); | ||||
blockToJSON(config, block, pblockindex, showTxDetails); | |||||
} | } | ||||
std::string strJSON = objBlock.write() + "\n"; | std::string strJSON = objBlock.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; | ||||
} | } | ||||
default: { | default: { | ||||
▲ Show 20 Lines • Show All 420 Lines • Show Last 20 Lines |