aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-05-10 13:35:44 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-06-04 09:16:05 +0200
commit53b4671a9de75f7c8e2903d510cf88867c3f6b97 (patch)
tree9bb3808d270e58f7c7a0a546110f5e9dbd941fc7 /src/rest.cpp
parent15982a8b69ec6ab3c3a6bf71fc6a9b681d3ff541 (diff)
downloadbitcoin-53b4671a9de75f7c8e2903d510cf88867c3f6b97.tar.xz
extend conversion to UniValue
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index 7c238d506d..5f64a0091c 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -222,7 +222,7 @@ static bool rest_block(AcceptedConnection* conn,
case RF_JSON: {
Object objBlock = blockToJSON(block, pblockindex, showTxDetails);
- string strJSON = write_string(Value(objBlock), false) + "\n";
+ string strJSON = objBlock.write() + "\n";
conn->stream() << HTTPReply(HTTP_OK, strJSON, fRun) << std::flush;
return true;
}
@@ -267,8 +267,7 @@ static bool rest_chaininfo(AcceptedConnection* conn,
case RF_JSON: {
Array rpcParams;
Value chainInfoObject = getblockchaininfo(rpcParams, false);
-
- string strJSON = write_string(chainInfoObject, false) + "\n";
+ string strJSON = chainInfoObject.write() + "\n";
conn->stream() << HTTPReply(HTTP_OK, strJSON, fRun) << std::flush;
return true;
}
@@ -319,7 +318,7 @@ static bool rest_tx(AcceptedConnection* conn,
case RF_JSON: {
Object objTx;
TxToJSON(tx, hashBlock, objTx);
- string strJSON = write_string(Value(objTx), false) + "\n";
+ string strJSON = objTx.write() + "\n";
conn->stream() << HTTPReply(HTTP_OK, strJSON, fRun) << std::flush;
return true;
}
@@ -516,7 +515,7 @@ static bool rest_getutxos(AcceptedConnection* conn,
objGetUTXOResponse.push_back(Pair("utxos", utxos));
// return json string
- string strJSON = write_string(Value(objGetUTXOResponse), false) + "\n";
+ string strJSON = objGetUTXOResponse.write() + "\n";
conn->stream() << HTTPReply(HTTP_OK, strJSON, fRun) << std::flush;
return true;
}