Fix build warning issues
This commit is contained in:
@@ -434,7 +434,7 @@ UniValue mempoolToJSON(bool fVerbose = false)
|
||||
if (fVerbose) {
|
||||
LOCK(mempool.cs);
|
||||
UniValue o(UniValue::VOBJ);
|
||||
for (const PAIRTYPE(uint256, CTxMemPoolEntry) & entry : mempool.mapTx) {
|
||||
for (const auto& entry : mempool.mapTx) {
|
||||
const uint256& hash = entry.first;
|
||||
const CTxMemPoolEntry& e = entry.second;
|
||||
UniValue info(UniValue::VOBJ);
|
||||
|
||||
+2
-2
@@ -418,7 +418,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
||||
UniValue lpval = NullUniValue;
|
||||
if (params.size() > 0) {
|
||||
const UniValue& oparam = params[0].get_obj();
|
||||
const UniValue& modeval = find_value(oparam, "mode");
|
||||
const UniValue modeval = find_value(oparam, "mode");
|
||||
if (modeval.isStr())
|
||||
strMode = modeval.get_str();
|
||||
else if (modeval.isNull()) {
|
||||
@@ -428,7 +428,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
||||
lpval = find_value(oparam, "longpollid");
|
||||
|
||||
if (strMode == "proposal") {
|
||||
const UniValue& dataval = find_value(oparam, "data");
|
||||
const UniValue dataval = find_value(oparam, "data");
|
||||
if (!dataval.isStr())
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, "Missing data String key for proposal");
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp)
|
||||
|
||||
uint256 txid = ParseHashO(o, "txid");
|
||||
|
||||
const UniValue& vout_v = find_value(o, "vout");
|
||||
const UniValue vout_v = find_value(o, "vout");
|
||||
if (!vout_v.isNum())
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing vout key");
|
||||
int nOutput = vout_v.get_int();
|
||||
@@ -393,7 +393,7 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp)
|
||||
uint32_t nSequence = (rawTx.nLockTime ? std::numeric_limits<uint32_t>::max() - 1 : std::numeric_limits<uint32_t>::max());
|
||||
|
||||
// set the sequence number if passed in the parameters object
|
||||
const UniValue& sequenceObj = find_value(o, "sequence");
|
||||
const UniValue sequenceObj = find_value(o, "sequence");
|
||||
if (sequenceObj.isNum()) {
|
||||
int64_t seqNr64 = sequenceObj.get_int64();
|
||||
if (seqNr64 < 0 || seqNr64 > std::numeric_limits<uint32_t>::max())
|
||||
@@ -1057,4 +1057,3 @@ UniValue createrawzerocoinpublicspend(const UniValue& params, bool fHelp)
|
||||
return EncodeHexTx(rawTx);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+2
-2
@@ -93,8 +93,8 @@ void RPCTypeCheckObj(const UniValue& o,
|
||||
const map<string, UniValue::VType>& typesExpected,
|
||||
bool fAllowNull)
|
||||
{
|
||||
for (const PAIRTYPE(string, UniValue::VType)& t : typesExpected) {
|
||||
const UniValue& v = find_value(o, t.first);
|
||||
for (const auto& t : typesExpected) {
|
||||
const UniValue v = find_value(o, t.first);
|
||||
if (!fAllowNull && v.isNull())
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Missing %s", t.first));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user