diff --git a/src/init.cpp b/src/init.cpp index 00e50ad10450f5..f81dc007be1c73 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1805,10 +1805,10 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) LOCK(pwalletMain->cs_wallet); LogPrintf("Locking Masternodes:\n"); uint256 mnTxHash; - int outputIndex; + uint32_t outputIndex; for (const auto& mne : masternodeConfig.getEntries()) { mnTxHash.SetHex(mne.getTxHash()); - outputIndex = boost::lexical_cast(mne.getOutputIndex()); + outputIndex = (uint32_t)atoi(mne.getOutputIndex()); COutPoint outpoint = COutPoint(mnTxHash, outputIndex); // don't lock non-spendable outpoint (i.e. it's already spent or it's not from this wallet at all) if(pwalletMain->IsMine(CTxIn(outpoint)) != ISMINE_SPENDABLE) { diff --git a/src/rpc/governance.cpp b/src/rpc/governance.cpp index 298b9d9d1f99a1..0d1f80fa914d23 100644 --- a/src/rpc/governance.cpp +++ b/src/rpc/governance.cpp @@ -25,8 +25,6 @@ #include "wallet/wallet.h" #endif // ENABLE_WALLET -#include - UniValue gobject(const JSONRPCRequest& request) { std::string strCommand; @@ -145,8 +143,8 @@ UniValue gobject(const JSONRPCRequest& request) std::string strRevision = request.params[2].get_str(); std::string strTime = request.params[3].get_str(); - int nRevision = boost::lexical_cast(strRevision); - int nTime = boost::lexical_cast(strTime); + int nRevision = atoi(strRevision); + int64_t nTime = atoi64(strTime); std::string strData = request.params[4].get_str(); // CREATE A NEW COLLATERAL TRANSACTION FOR THIS SPECIFIC OBJECT @@ -231,8 +229,8 @@ UniValue gobject(const JSONRPCRequest& request) std::string strRevision = request.params[2].get_str(); std::string strTime = request.params[3].get_str(); - int nRevision = boost::lexical_cast(strRevision); - int nTime = boost::lexical_cast(strTime); + int nRevision = atoi(strRevision); + int64_t nTime = atoi64(strTime); std::string strData = request.params[4].get_str(); CGovernanceObject govobj(hashParent, nRevision, nTime, txidFee, strData); @@ -818,8 +816,7 @@ UniValue gobject(const JSONRPCRequest& request) if (request.params.size() == 4) { uint256 txid = ParseHashV(request.params[2], "Masternode Collateral hash"); std::string strVout = request.params[3].get_str(); - uint32_t vout = boost::lexical_cast(strVout); - mnCollateralOutpoint = COutPoint(txid, vout); + mnCollateralOutpoint = COutPoint(txid, (uint32_t)atoi(strVout)); } // FIND OBJECT USER IS LOOKING FOR diff --git a/src/rpc/masternode.cpp b/src/rpc/masternode.cpp index 32be7a0e498fb3..52e00880056bfc 100644 --- a/src/rpc/masternode.cpp +++ b/src/rpc/masternode.cpp @@ -318,7 +318,7 @@ UniValue masternode(const JSONRPCRequest& request) for (const auto& mne : masternodeConfig.getEntries()) { std::string strError; - COutPoint outpoint = COutPoint(uint256S(mne.getTxHash()), uint32_t(atoi(mne.getOutputIndex().c_str()))); + COutPoint outpoint = COutPoint(uint256S(mne.getTxHash()), (uint32_t)atoi(mne.getOutputIndex())); CMasternode mn; bool fFound = mnodeman.Get(outpoint, mn); CMasternodeBroadcast mnb; @@ -366,7 +366,7 @@ UniValue masternode(const JSONRPCRequest& request) UniValue resultObj(UniValue::VOBJ); for (const auto& mne : masternodeConfig.getEntries()) { - COutPoint outpoint = COutPoint(uint256S(mne.getTxHash()), uint32_t(atoi(mne.getOutputIndex().c_str()))); + COutPoint outpoint = COutPoint(uint256S(mne.getTxHash()), (uint32_t)atoi(mne.getOutputIndex())); CMasternode mn; bool fFound = mnodeman.Get(outpoint, mn); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 66e5506da259ed..dcc15c9c8e040a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3228,7 +3228,7 @@ bool CWallet::GetMasternodeOutpointAndKeys(COutPoint& outpointRet, CPubKey& pubK // Find specific vin uint256 txHash = uint256S(strTxHash); - int nOutputIndex = atoi(strOutputIndex.c_str()); + int nOutputIndex = atoi(strOutputIndex); for (const auto& out : vPossibleCoins) if(out.tx->GetHash() == txHash && out.i == nOutputIndex) // found it!