[rpc] throw JSONRPCError when utxo set can not be read
This commit is contained in:
parent
14e8f9916b
commit
fa05cfdf25
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue