From a18707e397c878e7295d9af1c13879da2532557d Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 23 Jun 2021 10:52:50 +0300 Subject: [PATCH] Remove/fix unused variables --- src/bench/bench_dash.cpp | 1 - src/bench/bls_dkg.cpp | 2 -- src/bench/checkqueue.cpp | 1 - src/init.cpp | 1 - src/policy/fees.cpp | 2 +- src/qt/coincontroldialog.cpp | 1 - src/qt/networkstyle.cpp | 5 ++--- src/qt/walletframe.cpp | 2 +- src/support/allocators/mt_pooled_secure.h | 1 - src/test/evo_deterministicmns_tests.cpp | 1 - src/validation.cpp | 5 +---- src/wallet/wallet.cpp | 2 -- 12 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/bench/bench_dash.cpp b/src/bench/bench_dash.cpp index bcaf85d5d1..8fe2ddb0e2 100644 --- a/src/bench/bench_dash.cpp +++ b/src/bench/bench_dash.cpp @@ -20,7 +20,6 @@ const std::function G_TRANSLATION_FUN = nullptr; -static const int64_t DEFAULT_BENCH_EVALUATIONS = 5; static const char* DEFAULT_BENCH_FILTER = ".*"; void InitBLSTests(); diff --git a/src/bench/bls_dkg.cpp b/src/bench/bls_dkg.cpp index a101452979..07860b9516 100644 --- a/src/bench/bls_dkg.cpp +++ b/src/bench/bls_dkg.cpp @@ -86,8 +86,6 @@ public: ReceiveVvecs(); size_t memberIdx = 0; bench.minEpochIterations(epoch_iters).run([&] { - auto& m = members[memberIdx]; - ReceiveShares(memberIdx); std::set invalidIndexes; diff --git a/src/bench/checkqueue.cpp b/src/bench/checkqueue.cpp index 262cab96eb..97f799fa9d 100644 --- a/src/bench/checkqueue.cpp +++ b/src/bench/checkqueue.cpp @@ -11,7 +11,6 @@ #include -static const int MIN_CORES = 2; static const size_t BATCHES = 101; static const size_t BATCH_SIZE = 30; static const int PREVECTOR_SIZE = 28; diff --git a/src/init.cpp b/src/init.cpp index 7a923d7e94..7d33076812 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -2046,7 +2046,6 @@ bool AppInitMain() LogPrintf("* Using %.1fMiB for in-memory UTXO set (plus up to %.1fMiB of unused mempool space)\n", nCoinCacheUsage * (1.0 / 1024 / 1024), nMempoolSizeMax * (1.0 / 1024 / 1024)); bool fLoaded = false; - int64_t nStart = GetTimeMillis(); while (!fLoaded && !ShutdownRequested()) { bool fReset = fReindex; diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index aa0daa5122..1a3a42c0ea 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -925,7 +925,7 @@ bool CBlockPolicyEstimator::Read(CAutoFile& filein) try { LOCK(cs_feeEstimator); int nVersionRequired, nVersionThatWrote; - unsigned int nFileBestSeenHeight, nFileHistoricalFirst, nFileHistoricalBest; + unsigned int nFileBestSeenHeight; filein >> nVersionRequired >> nVersionThatWrote; if (nVersionRequired > CLIENT_VERSION) return error("CBlockPolicyEstimator::Read(): up-version (%d) fee estimate file", nVersionRequired); diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 3bbc26033a..d6a931d68a 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -481,7 +481,6 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel * unsigned int nBytes = 0; unsigned int nBytesInputs = 0; unsigned int nQuantity = 0; - int nQuantityUncompressed = 0; bool fUnselectedSpent{false}; bool fUnselectedNonMixed{false}; diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp index 639edda518..7a9c277e2c 100644 --- a/src/qt/networkstyle.cpp +++ b/src/qt/networkstyle.cpp @@ -42,9 +42,8 @@ void NetworkStyle::rotateColor(QColor& col, const int iconColorHueShift, const i col.setHsl(h,s,l,a); } -void NetworkStyle::rotateColors(QImage& img, const int iconColorHueShift, const int iconColorSaturationReduction) { - int h,s,l,a; - +void NetworkStyle::rotateColors(QImage& img, const int iconColorHueShift, const int iconColorSaturationReduction) +{ // traverse though lines for(int y=0;y::const_iterator i; - for (auto i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i) { + for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i) { i.value()->gotoCoinJoinCoinsPage(addr); } } diff --git a/src/support/allocators/mt_pooled_secure.h b/src/support/allocators/mt_pooled_secure.h index f6f891096c..38bd003e2c 100644 --- a/src/support/allocators/mt_pooled_secure.h +++ b/src/support/allocators/mt_pooled_secure.h @@ -63,7 +63,6 @@ struct mt_pooled_secure_allocator : public std::allocator { private: size_t get_bucket() { - auto tid = std::this_thread::get_id(); size_t x = std::hash{}(std::this_thread::get_id()); return x % pools.size(); } diff --git a/src/test/evo_deterministicmns_tests.cpp b/src/test/evo_deterministicmns_tests.cpp index a96824db2a..4d89c29541 100644 --- a/src/test/evo_deterministicmns_tests.cpp +++ b/src/test/evo_deterministicmns_tests.cpp @@ -517,7 +517,6 @@ BOOST_FIXTURE_TEST_CASE(dip3_test_mempool_reorg, TestChainDIP3Setup) BOOST_FIXTURE_TEST_CASE(dip3_test_mempool_dual_proregtx, TestChainDIP3Setup) { - int nHeight = chainActive.Height(); auto utxos = BuildSimpleUtxoMap(m_coinbase_txns); // Create a MN diff --git a/src/validation.cpp b/src/validation.cpp index 12223e8d40..f8e947c03f 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -693,8 +693,6 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool auto itConflicting = pool.mapNextTx.find(txin.prevout); if (itConflicting != pool.mapNextTx.end()) { - const CTransaction *ptxConflicting = itConflicting->second; - // Transaction conflicts with mempool and RBF doesn't exist in Dash return state.Invalid(false, REJECT_DUPLICATE, "txn-mempool-conflict"); } @@ -824,7 +822,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool // Check against previous transactions // This is done last to help prevent CPU exhaustion denial-of-service attacks. PrecomputedTransactionData txdata(tx); - if (!CheckInputs(tx, state, view, true, STANDARD_SCRIPT_VERIFY_FLAGS, true, false, txdata)) + if (!CheckInputs(tx, state, view, true, scriptVerifyFlags, true, false, txdata)) return false; // state filled in by CheckInputs // Check again against the current block tip's script verification @@ -1235,7 +1233,6 @@ bool IsInitialBlockDownload() return false; if (fImporting || fReindex) return true; - const CChainParams& chainParams = Params(); if (chainActive.Tip() == nullptr) return true; if (chainActive.Tip()->nChainWork < nMinimumChainWork) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 7a8766adef..415da8d2e4 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -5530,8 +5530,6 @@ void CMerkleTx::SetMerkleBranch(const CBlockIndex* pindex, int posInBlock) int CMerkleTx::GetDepthInMainChain() const { - int nResult; - if (hashUnset()) return 0;