mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
remove JSON Spirit UniValue wrapper
This commit is contained in:
@@ -34,7 +34,7 @@ using namespace std;
|
||||
* or from the last difficulty change if 'lookup' is nonpositive.
|
||||
* If 'height' is nonnegative, compute the estimate at the time when a given block was found.
|
||||
*/
|
||||
Value GetNetworkHashPS(int lookup, int height) {
|
||||
UniValue GetNetworkHashPS(int lookup, int height) {
|
||||
CBlockIndex *pb = chainActive.Tip();
|
||||
|
||||
if (height >= 0 && height < chainActive.Height())
|
||||
@@ -71,7 +71,7 @@ Value GetNetworkHashPS(int lookup, int height) {
|
||||
return (int64_t)(workDiff.getdouble() / timeDiff);
|
||||
}
|
||||
|
||||
Value getnetworkhashps(const Array& params, bool fHelp)
|
||||
UniValue getnetworkhashps(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() > 2)
|
||||
throw runtime_error(
|
||||
@@ -94,7 +94,7 @@ Value getnetworkhashps(const Array& params, bool fHelp)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
Value getgenerate(const Array& params, bool fHelp)
|
||||
UniValue getgenerate(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 0)
|
||||
throw runtime_error(
|
||||
@@ -113,7 +113,7 @@ Value getgenerate(const Array& params, bool fHelp)
|
||||
return GetBoolArg("-gen", false);
|
||||
}
|
||||
|
||||
Value generate(const Array& params, bool fHelp)
|
||||
UniValue generate(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() < 1 || params.size() > 1)
|
||||
throw runtime_error(
|
||||
@@ -172,7 +172,7 @@ Value generate(const Array& params, bool fHelp)
|
||||
}
|
||||
|
||||
|
||||
Value setgenerate(const Array& params, bool fHelp)
|
||||
UniValue setgenerate(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() < 1 || params.size() > 2)
|
||||
throw runtime_error(
|
||||
@@ -220,7 +220,7 @@ Value setgenerate(const Array& params, bool fHelp)
|
||||
#endif
|
||||
|
||||
|
||||
Value getmininginfo(const Array& params, bool fHelp)
|
||||
UniValue getmininginfo(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 0)
|
||||
throw runtime_error(
|
||||
@@ -266,7 +266,7 @@ Value getmininginfo(const Array& params, bool fHelp)
|
||||
|
||||
|
||||
// NOTE: Unlike wallet RPC (which use BTC values), mining RPCs follow GBT (BIP 22) in using satoshi amounts
|
||||
Value prioritisetransaction(const Array& params, bool fHelp)
|
||||
UniValue prioritisetransaction(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 3)
|
||||
throw runtime_error(
|
||||
@@ -298,7 +298,7 @@ Value prioritisetransaction(const Array& params, bool fHelp)
|
||||
|
||||
|
||||
// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
|
||||
static Value BIP22ValidationResult(const CValidationState& state)
|
||||
static UniValue BIP22ValidationResult(const CValidationState& state)
|
||||
{
|
||||
if (state.IsValid())
|
||||
return Value::null;
|
||||
@@ -316,7 +316,7 @@ static Value BIP22ValidationResult(const CValidationState& state)
|
||||
return "valid?";
|
||||
}
|
||||
|
||||
Value getblocktemplate(const Array& params, bool fHelp)
|
||||
UniValue getblocktemplate(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() > 1)
|
||||
throw runtime_error(
|
||||
@@ -381,7 +381,7 @@ Value getblocktemplate(const Array& params, bool fHelp)
|
||||
LOCK(cs_main);
|
||||
|
||||
std::string strMode = "template";
|
||||
Value lpval = NullUniValue;
|
||||
UniValue lpval = NullUniValue;
|
||||
if (params.size() > 0)
|
||||
{
|
||||
const Object& oparam = params[0].get_obj();
|
||||
@@ -605,7 +605,7 @@ protected:
|
||||
};
|
||||
};
|
||||
|
||||
Value submitblock(const Array& params, bool fHelp)
|
||||
UniValue submitblock(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() < 1 || params.size() > 2)
|
||||
throw runtime_error(
|
||||
@@ -666,7 +666,7 @@ Value submitblock(const Array& params, bool fHelp)
|
||||
return BIP22ValidationResult(state);
|
||||
}
|
||||
|
||||
Value estimatefee(const Array& params, bool fHelp)
|
||||
UniValue estimatefee(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 1)
|
||||
throw runtime_error(
|
||||
@@ -698,7 +698,7 @@ Value estimatefee(const Array& params, bool fHelp)
|
||||
return ValueFromAmount(feeRate.GetFeePerK());
|
||||
}
|
||||
|
||||
Value estimatepriority(const Array& params, bool fHelp)
|
||||
UniValue estimatepriority(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 1)
|
||||
throw runtime_error(
|
||||
|
||||
Reference in New Issue
Block a user