diff --git a/src/evo/cbtx.h b/src/evo/cbtx.h index b537c385a6..fd6d8c4011 100644 --- a/src/evo/cbtx.h +++ b/src/evo/cbtx.h @@ -42,7 +42,7 @@ class CCbTx int32_t nHeight{0}; uint256 merkleRootMNList; uint256 merkleRootQuorums; - uint32_t bestCLHeightDiff; + uint32_t bestCLHeightDiff{0}; CBLSSignature bestCLSignature; CAmount creditPoolBalance{0}; diff --git a/src/evo/mnhftx.cpp b/src/evo/mnhftx.cpp index 853ff3efc2..0ecaf5cff0 100644 --- a/src/evo/mnhftx.cpp +++ b/src/evo/mnhftx.cpp @@ -330,12 +330,12 @@ std::optional CMNHFManager::GetFromCache(const CBlockInde void CMNHFManager::AddToCache(const Signals& signals, const CBlockIndex* const pindex) { + assert(pindex != nullptr); const uint256& blockHash = pindex->GetBlockHash(); { LOCK(cs_cache); mnhfCache.insert(blockHash, signals); } - assert(pindex != nullptr); { LOCK(cs_cache); if (ThresholdState::ACTIVE != v20_activation.State(pindex->pprev, Params().GetConsensus(), Consensus::DEPLOYMENT_V20)) return; diff --git a/src/governance/governance.cpp b/src/governance/governance.cpp index 7d741cceae..6544d0fa82 100644 --- a/src/governance/governance.cpp +++ b/src/governance/governance.cpp @@ -367,11 +367,6 @@ void CGovernanceManager::UpdateCachesAndClean() while (it != mapObjects.end()) { CGovernanceObject* pObj = &((*it).second); - if (!pObj) { - ++it; - continue; - } - uint256 nHash = it->first; std::string strHash = nHash.ToString(); diff --git a/src/llmq/signing.cpp b/src/llmq/signing.cpp index e4482df68f..97e9019da7 100644 --- a/src/llmq/signing.cpp +++ b/src/llmq/signing.cpp @@ -1020,7 +1020,7 @@ CQuorumCPtr CSigningManager::SelectQuorumForSigning(const Consensus::LLMQParams& //Extract last 64 bits of selectionHash uint64_t b = selectionHash.GetUint64(3); //Take last n bits of b - uint64_t signer = (((1 << n) - 1) & (b >> (64 - n - 1))); + uint64_t signer = (((1ull << n) - 1) & (b >> (64 - n - 1))); if (signer > quorums.size()) { return nullptr; diff --git a/src/net.cpp b/src/net.cpp index 06429ba0dd..507c19c938 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -3291,8 +3291,7 @@ void CExplicitNetCleanup::callCleanup() { // Explicit call to destructor of CNetCleanup because it's not implicitly called // when the wallet is restarted from within the wallet itself. - CNetCleanup *tmp = new CNetCleanup(); - delete tmp; // Stroustrup's gonna kill me for that + CNetCleanup tmp; } void CConnman::Interrupt() @@ -3955,7 +3954,6 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg) statsClient.count("bandwidth.message." + SanitizeString(msg.command.c_str()) + ".bytesSent", nTotalSize, 1.0f); statsClient.inc("message.sent." + SanitizeString(msg.command.c_str()), 1.0f); - size_t nBytesSent = 0; { LOCK(pnode->cs_vSend); bool hasPendingData = !pnode->vSendMsg.empty(); @@ -3986,8 +3984,6 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg) if (!hasPendingData && wakeupSelectNeeded) WakeSelect(); } - if (nBytesSent) - RecordBytesSent(nBytesSent); } bool CConnman::ForNode(const CService& addr, std::function cond, std::function func) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 9bb08f7ad6..fd3b37f72d 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 nBytesInputs = 0; unsigned int nQuantity = 0; bool fUnselectedSpent{false}; - bool fUnselectedNonMixed{false}; std::vector vCoinControl; m_coin_control.ListSelected(vCoinControl); @@ -575,7 +574,7 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel * // actually update labels int nDisplayUnit = BitcoinUnits::DASH; - if (model && model->getOptionsModel()) + if (model->getOptionsModel()) nDisplayUnit = model->getOptionsModel()->getDisplayUnit(); QLabel *l1 = dialog->findChild("labelCoinControlQuantity"); @@ -639,10 +638,6 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel * QMessageBox::warning(dialog, "CoinControl", tr("Some coins were unselected because they were spent."), QMessageBox::Ok, QMessageBox::Ok); - } else if (fUnselectedNonMixed) { - QMessageBox::warning(dialog, "CoinControl", - tr("Some coins were unselected because they do not have enough mixing rounds."), - QMessageBox::Ok, QMessageBox::Ok); } } diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 0c14e1fc82..fa7aa54572 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -219,12 +219,10 @@ void OverviewPage::setBalance(const interfaces::WalletBalances& balances) updateCoinJoinProgress(); - if (walletModel) { - int numISLocks = walletModel->getNumISLocks(); - if(cachedNumISLocks != numISLocks) { - cachedNumISLocks = numISLocks; - ui->listTransactions->update(); - } + int numISLocks = walletModel->getNumISLocks(); + if(cachedNumISLocks != numISLocks) { + cachedNumISLocks = numISLocks; + ui->listTransactions->update(); } } @@ -638,7 +636,7 @@ void OverviewPage::toggleCoinJoin(){ } // if wallet is locked, ask for a passphrase - if (walletModel && walletModel->getEncryptionStatus() == WalletModel::Locked) + if (walletModel->getEncryptionStatus() == WalletModel::Locked) { WalletModel::UnlockContext ctx(walletModel->requestUnlock(true)); if(!ctx.isValid())