Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
309 changes: 151 additions & 158 deletions src/governance-classes.cpp

Large diffs are not rendered by default.

41 changes: 18 additions & 23 deletions src/governance-classes.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 The Dash Core developers
// Copyright (c) 2014-2018 The Dash Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef GOVERNANCE_CLASSES_H
Expand Down Expand Up @@ -44,7 +44,8 @@ class CGovernanceTriggerManager
void CleanAndRemove();

public:
CGovernanceTriggerManager() : mapTrigger() {}
CGovernanceTriggerManager() :
mapTrigger() {}
};

/**
Expand All @@ -59,7 +60,6 @@ class CSuperblockManager
static bool GetBestSuperblock(CSuperblock_sptr& pSuperblockRet, int nBlockHeight);

public:

static bool IsSuperblockTriggered(int nBlockHeight);

static bool GetSuperblockPayments(int nBlockHeight, std::vector<CTxOut>& voutSuperblockRet);
Expand All @@ -83,33 +83,29 @@ class CGovernancePayment
CScript script;
CAmount nAmount;

CGovernancePayment()
:fValid(false),
script(),
nAmount(0)
{}
CGovernancePayment() :
fValid(false),
script(),
nAmount(0)
{
}

CGovernancePayment(CBitcoinAddress addrIn, CAmount nAmountIn)
:fValid(false),
script(),
nAmount(0)
CGovernancePayment(CBitcoinAddress addrIn, CAmount nAmountIn) :
fValid(false),
script(),
nAmount(0)
{
try
{
try {
CTxDestination dest = addrIn.Get();
script = GetScriptForDestination(dest);
nAmount = nAmountIn;
fValid = true;
}
catch(std::exception& e)
{
} catch (std::exception& e) {
LogPrintf("CGovernancePayment Payment not valid: addrIn = %s, nAmountIn = %d, what = %s\n",
addrIn.ToString(), nAmountIn, e.what());
}
catch(...)
{
addrIn.ToString(), nAmountIn, e.what());
} catch (...) {
LogPrintf("CGovernancePayment Payment not valid: addrIn = %s, nAmountIn = %d\n",
addrIn.ToString(), nAmountIn);
addrIn.ToString(), nAmountIn);
}
}

Expand Down Expand Up @@ -146,7 +142,6 @@ class CSuperblock : public CGovernanceObject
void ParsePaymentSchedule(const std::string& strPaymentAddresses, const std::string& strPaymentAmounts);

public:

CSuperblock();
CSuperblock(uint256& nHash);

Expand Down
19 changes: 10 additions & 9 deletions src/governance-exceptions.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 The Dash Core developers
// Copyright (c) 2014-2018 The Dash Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand All @@ -25,7 +25,7 @@ enum governance_exception_type_enum_t {

inline std::ostream& operator<<(std::ostream& os, governance_exception_type_enum_t eType)
{
switch(eType) {
switch (eType) {
case GOVERNANCE_EXCEPTION_NONE:
os << "GOVERNANCE_EXCEPTION_NONE";
break;
Expand Down Expand Up @@ -63,11 +63,11 @@ class CGovernanceException : public std::exception

public:
CGovernanceException(const std::string& strMessageIn = "",
governance_exception_type_enum_t eTypeIn = GOVERNANCE_EXCEPTION_NONE,
int nNodePenaltyIn = 0)
: strMessage(),
eType(eTypeIn),
nNodePenalty(nNodePenaltyIn)
governance_exception_type_enum_t eTypeIn = GOVERNANCE_EXCEPTION_NONE,
int nNodePenaltyIn = 0) :
strMessage(),
eType(eTypeIn),
nNodePenalty(nNodePenaltyIn)
{
std::ostringstream ostr;
ostr << eType << ":" << strMessageIn;
Expand All @@ -76,7 +76,7 @@ class CGovernanceException : public std::exception

virtual ~CGovernanceException() throw() {}

virtual const char* what() const throw() override
virtual const char* what() const throw() override
{
return strMessage.c_str();
}
Expand All @@ -91,7 +91,8 @@ class CGovernanceException : public std::exception
return eType;
}

int GetNodePenalty() const {
int GetNodePenalty() const
{
return nNodePenalty;
}
};
Expand Down
Loading