Merge #8832: [rpc] throw JSONRPCError when utxo set can not be read

fa05cfd [rpc] throw JSONRPCError when utxo set can not be read (MarcoFalke)
This commit is contained in:
Wladimir J. van der Laan 2016-09-29 07:59:22 +02:00
commit 7d563cc16d
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6

View File

@ -848,6 +848,8 @@ UniValue gettxoutsetinfo(const UniValue& params, bool fHelp)
ret.push_back(Pair("bytes_serialized", (int64_t)stats.nSerializedSize)); ret.push_back(Pair("bytes_serialized", (int64_t)stats.nSerializedSize));
ret.push_back(Pair("hash_serialized", stats.hashSerialized.GetHex())); ret.push_back(Pair("hash_serialized", stats.hashSerialized.GetHex()));
ret.push_back(Pair("total_amount", ValueFromAmount(stats.nTotalAmount))); ret.push_back(Pair("total_amount", ValueFromAmount(stats.nTotalAmount)));
} else {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Unable to read UTXO set");
} }
return ret; return ret;
} }