diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-05-10 14:48:35 +0200 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-06-04 09:16:05 +0200 |
commit | 6c7bee062437acbc078533fdcf8e53794031bf99 (patch) | |
tree | 9af2921524e39c6c25df31fba9d1dd55e03ba04b /src/rest.cpp | |
parent | 53b4671a9de75f7c8e2903d510cf88867c3f6b97 (diff) |
expicit set UniValue type to avoid empty values
Diffstat (limited to 'src/rest.cpp')
-rw-r--r-- | src/rest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rest.cpp b/src/rest.cpp index 5f64a0091c..f3195746ba 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -265,7 +265,7 @@ static bool rest_chaininfo(AcceptedConnection* conn, switch (rf) { case RF_JSON: { - Array rpcParams; + UniValue rpcParams(UniValue::VARR); Value chainInfoObject = getblockchaininfo(rpcParams, false); string strJSON = chainInfoObject.write() + "\n"; conn->stream() << HTTPReply(HTTP_OK, strJSON, fRun) << std::flush; @@ -316,7 +316,7 @@ static bool rest_tx(AcceptedConnection* conn, } case RF_JSON: { - Object objTx; + UniValue objTx(UniValue::VOBJ); TxToJSON(tx, hashBlock, objTx); string strJSON = objTx.write() + "\n"; conn->stream() << HTTPReply(HTTP_OK, strJSON, fRun) << std::flush; @@ -491,7 +491,7 @@ static bool rest_getutxos(AcceptedConnection* conn, } case RF_JSON: { - Object objGetUTXOResponse; + UniValue objGetUTXOResponse(UniValue::VOBJ); // pack in some essentials // use more or less the same output as mentioned in Bip64 @@ -499,15 +499,15 @@ static bool rest_getutxos(AcceptedConnection* conn, objGetUTXOResponse.push_back(Pair("chaintipHash", chainActive.Tip()->GetBlockHash().GetHex())); objGetUTXOResponse.push_back(Pair("bitmap", bitmapStringRepresentation)); - Array utxos; + UniValue utxos(UniValue::VARR); BOOST_FOREACH (const CCoin& coin, outs) { - Object utxo; + UniValue utxo(UniValue::VOBJ); utxo.push_back(Pair("txvers", (int32_t)coin.nTxVer)); utxo.push_back(Pair("height", (int32_t)coin.nHeight)); utxo.push_back(Pair("value", ValueFromAmount(coin.out.nValue))); // include the script in a json output - Object o; + UniValue o(UniValue::VOBJ); ScriptPubKeyToJSON(coin.out.scriptPubKey, o, true); utxo.push_back(Pair("scriptPubKey", o)); utxos.push_back(utxo); |