Fix build warning issues
This commit is contained in:
+1
-1
@@ -153,7 +153,7 @@ inline std::string Hash(std::string input)
|
|||||||
unsigned char hash[CSHA256::OUTPUT_SIZE];
|
unsigned char hash[CSHA256::OUTPUT_SIZE];
|
||||||
CSHA256().Write((const unsigned char*)input.data(), input.size()).Finalize(hash);
|
CSHA256().Write((const unsigned char*)input.data(), input.size()).Finalize(hash);
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
for (int i = 0; i < CSHA256::OUTPUT_SIZE; i++) {
|
for (size_t i = 0; i < CSHA256::OUTPUT_SIZE; i++) {
|
||||||
ss << hex << setw(2) << setfill('0') << (int)hash[i];
|
ss << hex << setw(2) << setfill('0') << (int)hash[i];
|
||||||
}
|
}
|
||||||
return ss.str();
|
return ss.str();
|
||||||
|
|||||||
+3
-4
@@ -33,7 +33,7 @@ namespace invalid_out
|
|||||||
const UniValue &val = v[idx];
|
const UniValue &val = v[idx];
|
||||||
const UniValue &o = val.get_obj();
|
const UniValue &o = val.get_obj();
|
||||||
|
|
||||||
const UniValue &vTxid = find_value(o, "txid");
|
const UniValue vTxid = find_value(o, "txid");
|
||||||
if (!vTxid.isStr())
|
if (!vTxid.isStr())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ namespace invalid_out
|
|||||||
if (txid == 0)
|
if (txid == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const UniValue &vN = find_value(o, "n");
|
const UniValue vN = find_value(o, "n");
|
||||||
if (!vN.isNum())
|
if (!vN.isNum())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ namespace invalid_out
|
|||||||
const UniValue &val = v[idx];
|
const UniValue &val = v[idx];
|
||||||
const UniValue &o = val.get_obj();
|
const UniValue &o = val.get_obj();
|
||||||
|
|
||||||
const UniValue &vSerial = find_value(o, "s");
|
const UniValue vSerial = find_value(o, "s");
|
||||||
if (!vSerial.isStr())
|
if (!vSerial.isStr())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -87,4 +87,3 @@ namespace invalid_out
|
|||||||
return static_cast<bool>(setInvalidSerials.count(bnSerial));
|
return static_cast<bool>(setInvalidSerials.count(bnSerial));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ bool SerialNumberSignatureOfKnowledge::Verify(const CBigNum& coinSerialNumber, c
|
|||||||
hasher << tprime[i];
|
hasher << tprime[i];
|
||||||
}
|
}
|
||||||
return hasher.GetHash() == hash;
|
return hasher.GetHash() == hash;
|
||||||
}catch (std::range_error e){
|
}catch (const std::range_error& e){
|
||||||
return error("SoK Verify() :: sprime invalid range.");
|
return error("SoK Verify() :: sprime invalid range.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ bool CMasternodeConfig::CMasternodeEntry::castOutputIndex(int &n)
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
n = std::stoi(outputIndex);
|
n = std::stoi(outputIndex);
|
||||||
} catch (const std::exception e) {
|
} catch (const std::exception& e) {
|
||||||
LogPrintf("%s: %s on getOutputIndex\n", __func__, e.what());
|
LogPrintf("%s: %s on getOutputIndex\n", __func__, e.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ UniValue mempoolToJSON(bool fVerbose = false)
|
|||||||
if (fVerbose) {
|
if (fVerbose) {
|
||||||
LOCK(mempool.cs);
|
LOCK(mempool.cs);
|
||||||
UniValue o(UniValue::VOBJ);
|
UniValue o(UniValue::VOBJ);
|
||||||
for (const PAIRTYPE(uint256, CTxMemPoolEntry) & entry : mempool.mapTx) {
|
for (const auto& entry : mempool.mapTx) {
|
||||||
const uint256& hash = entry.first;
|
const uint256& hash = entry.first;
|
||||||
const CTxMemPoolEntry& e = entry.second;
|
const CTxMemPoolEntry& e = entry.second;
|
||||||
UniValue info(UniValue::VOBJ);
|
UniValue info(UniValue::VOBJ);
|
||||||
|
|||||||
+2
-2
@@ -418,7 +418,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
UniValue lpval = NullUniValue;
|
UniValue lpval = NullUniValue;
|
||||||
if (params.size() > 0) {
|
if (params.size() > 0) {
|
||||||
const UniValue& oparam = params[0].get_obj();
|
const UniValue& oparam = params[0].get_obj();
|
||||||
const UniValue& modeval = find_value(oparam, "mode");
|
const UniValue modeval = find_value(oparam, "mode");
|
||||||
if (modeval.isStr())
|
if (modeval.isStr())
|
||||||
strMode = modeval.get_str();
|
strMode = modeval.get_str();
|
||||||
else if (modeval.isNull()) {
|
else if (modeval.isNull()) {
|
||||||
@@ -428,7 +428,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
lpval = find_value(oparam, "longpollid");
|
lpval = find_value(oparam, "longpollid");
|
||||||
|
|
||||||
if (strMode == "proposal") {
|
if (strMode == "proposal") {
|
||||||
const UniValue& dataval = find_value(oparam, "data");
|
const UniValue dataval = find_value(oparam, "data");
|
||||||
if (!dataval.isStr())
|
if (!dataval.isStr())
|
||||||
throw JSONRPCError(RPC_TYPE_ERROR, "Missing data String key for proposal");
|
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");
|
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())
|
if (!vout_v.isNum())
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing vout key");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing vout key");
|
||||||
int nOutput = vout_v.get_int();
|
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());
|
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
|
// 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()) {
|
if (sequenceObj.isNum()) {
|
||||||
int64_t seqNr64 = sequenceObj.get_int64();
|
int64_t seqNr64 = sequenceObj.get_int64();
|
||||||
if (seqNr64 < 0 || seqNr64 > std::numeric_limits<uint32_t>::max())
|
if (seqNr64 < 0 || seqNr64 > std::numeric_limits<uint32_t>::max())
|
||||||
@@ -1057,4 +1057,3 @@ UniValue createrawzerocoinpublicspend(const UniValue& params, bool fHelp)
|
|||||||
return EncodeHexTx(rawTx);
|
return EncodeHexTx(rawTx);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -93,8 +93,8 @@ void RPCTypeCheckObj(const UniValue& o,
|
|||||||
const map<string, UniValue::VType>& typesExpected,
|
const map<string, UniValue::VType>& typesExpected,
|
||||||
bool fAllowNull)
|
bool fAllowNull)
|
||||||
{
|
{
|
||||||
for (const PAIRTYPE(string, UniValue::VType)& t : typesExpected) {
|
for (const auto& t : typesExpected) {
|
||||||
const UniValue& v = find_value(o, t.first);
|
const UniValue v = find_value(o, t.first);
|
||||||
if (!fAllowNull && v.isNull())
|
if (!fAllowNull && v.isNull())
|
||||||
throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Missing %s", t.first));
|
throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Missing %s", t.first));
|
||||||
|
|
||||||
|
|||||||
@@ -3365,7 +3365,7 @@ UniValue importzerocoins(const UniValue& params, bool fHelp)
|
|||||||
const UniValue &val = arrMints[idx];
|
const UniValue &val = arrMints[idx];
|
||||||
const UniValue &o = val.get_obj();
|
const UniValue &o = val.get_obj();
|
||||||
|
|
||||||
const UniValue& vDenom = find_value(o, "d");
|
const UniValue vDenom = find_value(o, "d");
|
||||||
if (!vDenom.isNum())
|
if (!vDenom.isNum())
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing d key");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing d key");
|
||||||
int d = vDenom.get_int();
|
int d = vDenom.get_int();
|
||||||
@@ -3389,7 +3389,7 @@ UniValue importzerocoins(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
//Assume coin is version 1 unless it has the version actually set
|
//Assume coin is version 1 unless it has the version actually set
|
||||||
uint8_t nVersion = 1;
|
uint8_t nVersion = 1;
|
||||||
const UniValue& vVersion = find_value(o, "v");
|
const UniValue vVersion = find_value(o, "v");
|
||||||
if (vVersion.isNum())
|
if (vVersion.isNum())
|
||||||
nVersion = static_cast<uint8_t>(vVersion.get_int());
|
nVersion = static_cast<uint8_t>(vVersion.get_int());
|
||||||
|
|
||||||
|
|||||||
@@ -1077,7 +1077,7 @@ bool AttemptBackupWallet(const CWallet& wallet, const filesystem::path& pathSrc,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#if BOOST_VERSION >= 105800 /* BOOST_LIB_VERSION 1_58 */
|
#if BOOST_VERSION >= 105800 /* BOOST_LIB_VERSION 1_58 */
|
||||||
filesystem::copy_file(pathSrc.c_str(), pathDest, filesystem::copy_options::overwrite_existing);
|
filesystem::copy_file(pathSrc.c_str(), pathDest, filesystem::copy_option::overwrite_if_exists);
|
||||||
#else
|
#else
|
||||||
std::ifstream src(pathSrc.c_str(), std::ios::binary | std::ios::in);
|
std::ifstream src(pathSrc.c_str(), std::ios::binary | std::ios::in);
|
||||||
std::ofstream dst(pathDest.c_str(), std::ios::binary | std::ios::out | std::ios::trunc);
|
std::ofstream dst(pathDest.c_str(), std::ios::binary | std::ios::out | std::ios::trunc);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace AccumulatorCheckpoints
|
|||||||
const UniValue &val = v[idx];
|
const UniValue &val = v[idx];
|
||||||
const UniValue &o = val.get_obj();
|
const UniValue &o = val.get_obj();
|
||||||
|
|
||||||
const UniValue &vHeight = find_value(o, "height");
|
const UniValue vHeight = find_value(o, "height");
|
||||||
if (!vHeight.isNum())
|
if (!vHeight.isNum())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ namespace AccumulatorCheckpoints
|
|||||||
|
|
||||||
Checkpoint checkpoint;
|
Checkpoint checkpoint;
|
||||||
for (auto denom : libzerocoin::zerocoinDenomList) {
|
for (auto denom : libzerocoin::zerocoinDenomList) {
|
||||||
const UniValue& vDenomValue = find_value(o, std::to_string(denom));
|
const UniValue vDenomValue = find_value(o, std::to_string(denom));
|
||||||
if (!vDenomValue.isStr()) {
|
if (!vDenomValue.isStr()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -82,4 +82,3 @@ namespace AccumulatorCheckpoints
|
|||||||
return Checkpoint();
|
return Checkpoint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user