Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
build
guix
ci
lint
chore
revert
trivial
Expand Down
2 changes: 1 addition & 1 deletion src/active/dkgsessionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static void RelayInvToParticipants(const CDKGSession& session, const CConnman& c
"HasMasternodeQuorumNodes[%d] for quorumHash[%s] forMember[%s] relayMembers[%s]",
inv.ToString(), relayMembers.size(), connman.GetNodeCount(ConnectionDirection::Both),
connman.GetNetworkActive(),
connman.HasMasternodeQuorumNodes(session.GetParams().type, session.BlockIndex()->GetBlockHash()),
connman.HasMasternodeQuorumNodes(session.GetType(), session.BlockIndex()->GetBlockHash()),
session.BlockIndex()->GetBlockHash().ToString(), session.ProTx().ToString().substr(0, 4), ss.str());

std::stringstream ss2;
Expand Down
3 changes: 1 addition & 2 deletions src/bls/bls.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class CBLSLazyWrapper
private:
mutable std::mutex mutex;

mutable std::array<uint8_t, BLSObject::SerSize> vecBytes;
mutable std::array<uint8_t, BLSObject::SerSize> vecBytes{};

mutable BLSObject obj;
mutable bool objInitialized{false};
Expand All @@ -403,7 +403,6 @@ class CBLSLazyWrapper

public:
CBLSLazyWrapper() :
vecBytes{},
bufLegacyScheme(bls::bls_legacy_scheme.load())
{}

Expand Down
2 changes: 1 addition & 1 deletion src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static constexpr int64_t TIMESTAMP_WINDOW = MAX_FUTURE_BLOCK_TIME;
*/
static constexpr int64_t MAX_BLOCK_TIME_GAP = 25 * 60;

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

class CBlockFileInfo
{
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/coinjoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CChainLocksHandler;
class CInstantSendManager;
} // namespace llmq

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

// timeouts
static constexpr int COINJOIN_AUTO_TIMEOUT_MIN = 5;
Expand Down
15 changes: 6 additions & 9 deletions src/cxxtimer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,17 @@ class Timer {
typename duration_t::rep count() const;

private:

bool started_;
bool paused_;
std::chrono::steady_clock::time_point reference_;
std::chrono::duration<long double> accumulated_;
bool started_{false};
bool paused_{false};
std::chrono::steady_clock::time_point reference_{std::chrono::steady_clock::now()};
std::chrono::duration<long double> accumulated_{std::chrono::duration<long double>(0)};
};

}


inline cxxtimer::Timer::Timer(bool start) :
started_(false), paused_(false),
reference_(std::chrono::steady_clock::now()),
accumulated_(std::chrono::duration<long double>(0)) {
inline cxxtimer::Timer::Timer(bool start)
{
if (start) {
this->start();
}
Expand Down
2 changes: 1 addition & 1 deletion src/evo/deterministicmns.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CSpecialTxProcessor;
class TxValidationState;
struct RPCResult;

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

class CDeterministicMN
{
Expand Down
2 changes: 1 addition & 1 deletion src/evo/dmn_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ constexpr auto Invalid = mntype_struct{

} // namespace dmn_types

[[nodiscard]] constexpr const dmn_types::mntype_struct GetMnType(MnType type)
[[nodiscard]] constexpr dmn_types::mntype_struct GetMnType(MnType type)
{
switch (type) {
case MnType::Regular: return dmn_types::Regular;
Expand Down
2 changes: 1 addition & 1 deletion src/evo/mnhftx.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MNHFTx
SERIALIZE_METHODS(MNHFTx, obj)
{
READWRITE(obj.versionBit, obj.quorumHash);
READWRITE(CBLSSignatureVersionWrapper(const_cast<CBLSSignature&>(obj.sig), /* fLegacy= */ false));
READWRITE(CBLSSignatureVersionWrapper(const_cast<CBLSSignature&>(obj.sig), /*legacy=*/false));
}

std::string ToString() const;
Expand Down
2 changes: 1 addition & 1 deletion src/evo/smldiff.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CQuorumBlockProcessor;
class CQuorumManager;
} // namespace llmq

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

/// P2P messages

Expand Down
2 changes: 1 addition & 1 deletion src/evo/specialtxman.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CQuorumManager;
class CQuorumSnapshotManager;
} // namespace llmq

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

class CSpecialTxProcessor
{
Expand Down
2 changes: 1 addition & 1 deletion src/governance/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CSuperblock : public CGovernanceObject
return nBlockHeight;
}

const uint256 GetGovernanceObjHash() const { return nGovObjHash; }
uint256 GetGovernanceObjHash() const { return nGovObjHash; }

int CountPayments() const { return (int)vecPayments.size(); }
bool GetPayment(int nPaymentIndex, CGovernancePayment& paymentRet);
Expand Down
15 changes: 5 additions & 10 deletions src/governance/governance.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,20 @@ using vote_time_pair_t = std::pair<CGovernanceVote, int64_t>;
static constexpr int RATE_BUFFER_SIZE = 5;
static constexpr bool DEFAULT_GOVERNANCE_ENABLE{true};

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

class CRateCheckBuffer
{
private:
std::vector<int64_t> vecTimestamps;

int nDataStart;

int nDataEnd;

bool fBufferEmpty;
int nDataStart{0};
int nDataEnd{0};
bool fBufferEmpty{true};

public:
CRateCheckBuffer() :
vecTimestamps(RATE_BUFFER_SIZE),
nDataStart(0),
nDataEnd(0),
fBufferEmpty(true)
vecTimestamps(RATE_BUFFER_SIZE)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/governance/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ChainstateManager;
class CMasternodeMetaMan;
struct RPCResult;

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

static constexpr double GOVERNANCE_FILTER_FP_RATE = 0.001;
static constexpr CAmount GOVERNANCE_PROPOSAL_FEE_TX = (1 * COIN);
Expand Down
1 change: 0 additions & 1 deletion src/governance/validators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const size_t MAX_NAME_SIZE = 40;

CProposalValidator::CProposalValidator(const std::string& strHexData, bool fAllowScript) :
objJSON(UniValue::VOBJ),
fJSONValid(false),
fAllowScript(fAllowScript),
strErrorMessages()
{
Expand Down
2 changes: 1 addition & 1 deletion src/governance/validators.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CProposalValidator
{
private:
UniValue objJSON;
bool fJSONValid;
bool fJSONValid{false};
bool fAllowScript;
std::string strErrorMessages;

Expand Down
1 change: 0 additions & 1 deletion src/governance/votedb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <governance/votedb.h>

CGovernanceObjectVoteFile::CGovernanceObjectVoteFile() :
nMemoryVotes(0),
listVotes(),
mapVoteIndex()
{
Expand Down
2 changes: 1 addition & 1 deletion src/governance/votedb.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CGovernanceObjectVoteFile
using vote_m_t = std::map<uint256, vote_l_t::iterator>;

private:
int nMemoryVotes;
int nMemoryVotes{0};

vote_l_t listVotes;

Expand Down
2 changes: 1 addition & 1 deletion src/llmq/blockprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CDeterministicMNManager;
class CEvoDB;
class CNode;

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

namespace llmq
{
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/dkgsession.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class CDKGSession
[[nodiscard]] const Uint256HashSet& RelayMembers() const { return relayMembers; }
[[nodiscard]] const CBlockIndex* BlockIndex() const { return m_quorum_base_block_index; }
[[nodiscard]] const uint256& ProTx() const { return myProTxHash; }
[[nodiscard]] const Consensus::LLMQParams GetParams() const { return params; }
[[nodiscard]] Consensus::LLMQType GetType() const { return params.type; }

protected:
virtual bool MaybeDecrypt(const CBLSIESMultiRecipientObjects<CBLSSecretKey>& obj, size_t idx,
Expand Down
2 changes: 1 addition & 1 deletion src/masternode/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class MasternodeMetaStore
std::vector<uint256> tmpUsedMasternodes;
s >> tmpMetaInfo >> nDsqCount >> tmpUsedMasternodes;
for (auto& mm : tmpMetaInfo) {
metaInfos.emplace(mm.m_protx_hash, CMasternodeMetaInfo{std::move(mm)});
metaInfos.emplace(mm.m_protx_hash, CMasternodeMetaInfo{mm});
}

// Convert vector to deque and build unordered_set for O(1) lookups
Expand Down
2 changes: 1 addition & 1 deletion src/node/blockstorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <unordered_map>
#include <vector>

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

class ArgsManager;
class BlockValidationState;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/appearancewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AppearanceWidget : public QWidget
Q_OBJECT

public:
explicit AppearanceWidget(QWidget* parent = 0);
explicit AppearanceWidget(QWidget* parent = nullptr);
~AppearanceWidget();

void setModel(OptionsModel* model);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/masternodelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MasternodeList : public QWidget
Q_OBJECT

public:
explicit MasternodeList(QWidget* parent = 0);
explicit MasternodeList(QWidget* parent = nullptr);
~MasternodeList();

enum {
Expand Down
1 change: 0 additions & 1 deletion src/qt/mnemonicverificationdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ MnemonicVerificationDialog::MnemonicVerificationDialog(const SecureString& mnemo
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::MnemonicVerificationDialog),
m_mnemonic(mnemonic),
m_mnemonic_revealed(false),
m_view_only(viewOnly)
{
ui->setupUi(this);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/mnemonicverificationdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private Q_SLOTS:
SecureString m_mnemonic;
std::vector<SecureString> m_words;
QList<int> m_selected_positions;
bool m_mnemonic_revealed;
bool m_mnemonic_revealed{false};
bool m_has_ever_revealed{false};
bool m_view_only{false};
class QGridLayout* m_gridLayout{nullptr};
Expand Down
11 changes: 4 additions & 7 deletions src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,10 @@
#include <QSystemTrayIcon>
#include <QTimer>

OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::OptionsDialog),
model(nullptr),
mapper(nullptr),
pageButtons(nullptr),
m_enable_wallet(enableWallet)
OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
: QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::OptionsDialog),
m_enable_wallet(enableWallet)
{
ui->setupUi(this);

Expand Down
1 change: 0 additions & 1 deletion src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ class TxViewDelegate : public QAbstractItemDelegate

OverviewPage::OverviewPage(QWidget* parent) :
QWidget(parent),
timer(nullptr),
ui(new Ui::OverviewPage),
clientModel(nullptr),
walletModel(nullptr),
Expand Down
2 changes: 1 addition & 1 deletion src/qt/overviewpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Q_SLOTS:
void outOfSyncWarningClicked();

private:
QTimer *timer;
QTimer* timer{nullptr};
Ui::OverviewPage *ui;
ClientModel *clientModel;
WalletModel *walletModel;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/qrdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class QRDialog : public QDialog
Q_OBJECT

public:
explicit QRDialog(QWidget *parent = 0);
explicit QRDialog(QWidget* parent = nullptr);
~QRDialog();

void setInfo(QString strWindowtitle, QString strQRCode, QString strTextInfo, QString strQRCodeTitle);
Expand Down
5 changes: 1 addition & 4 deletions src/qt/trafficgraphdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ const int TrafficGraphData::SMALLEST_SAMPLE_PERIOD =
TrafficGraphData::RangeMinutes[TrafficGraphData::Range_5m] * 60 * 1000 / TrafficGraphData::DESIRED_DATA_SAMPLES;

TrafficGraphData::TrafficGraphData(GraphRange range)
:currentGraphRange(range),
currentSampleCounter(0),
nLastBytesIn(0),
nLastBytesOut(0)
:currentGraphRange(range)
{
}

Expand Down
6 changes: 3 additions & 3 deletions src/qt/trafficgraphdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ class TrafficGraphData
SampleQueueMap sampleStash;

GraphRange currentGraphRange;
int currentSampleCounter;
int currentSampleCounter{0};

quint64 nLastBytesIn;
quint64 nLastBytesOut;
quint64 nLastBytesIn{0};
quint64 nLastBytesOut{0};

void update(GraphRange range, const TrafficSample &trafficSample);

Expand Down
8 changes: 3 additions & 5 deletions src/qt/trafficgraphwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
#define XMARGIN 10
#define YMARGIN 10

#define DEFAULT_SAMPLE_HEIGHT 1.1f

TrafficGraphWidget::TrafficGraphWidget(QWidget *parent) :
QWidget(parent),
timer(nullptr),
fMax(DEFAULT_SAMPLE_HEIGHT),
fMax(default_sample_height),
nMins(0),
clientModel(nullptr),
trafficGraphData(TrafficGraphData::Range_30m)
Expand Down Expand Up @@ -234,7 +232,7 @@ void TrafficGraphWidget::updateRates()
bool updated = trafficGraphData.update(clientModel->node().getTotalBytesRecv(),clientModel->node().getTotalBytesSent());

if (updated){
float tmax = DEFAULT_SAMPLE_HEIGHT;
float tmax = default_sample_height;
for (const TrafficSample& sample : trafficGraphData.getCurrentRangeQueueWithAverageBandwidth()) {
if(sample.in > tmax) tmax = sample.in;
if(sample.out > tmax) tmax = sample.out;
Expand All @@ -253,7 +251,7 @@ void TrafficGraphWidget::setGraphRangeMins(int value)
void TrafficGraphWidget::clear()
{
trafficGraphData.clear();
fMax = DEFAULT_SAMPLE_HEIGHT;
fMax = default_sample_height;
if(clientModel) {
trafficGraphData.setLastBytes(clientModel->node().getTotalBytesRecv(), clientModel->node().getTotalBytesSent());
}
Expand Down
1 change: 1 addition & 0 deletions src/qt/trafficgraphwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public Q_SLOTS:
void clear();

private:
static constexpr float default_sample_height{1.1f};
typedef std::function<float(const TrafficSample&)> SampleChooser;
void paintPath(QPainterPath &path, const TrafficGraphData::SampleQueue &queue, SampleChooser chooser);

Expand Down
2 changes: 1 addition & 1 deletion src/rpc/blockchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <optional>
#include <vector>

extern RecursiveMutex cs_main;
extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)

class CBlock;
class CBlockIndex;
Expand Down
Loading