Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deterministic Masternodes GUI + Bug Fixes #2791

Closed
wants to merge 84 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c7e332d
mnmodel: implement MN wrapper first step
furszy Jan 25, 2022
fce0cc0
Move FundSpecialTx function from rpcevo.cpp to specialtx_utils.cpp
furszy Jan 18, 2022
1514e45
Move CalcTxInputsHash from specialtx_validation.h to transaction.h
furszy Jan 19, 2022
d8cedee
Move SignSpecialTxPayload* functions to specialtx_utils
furszy Jan 21, 2022
9b03564
RPC: Remove extra special tx validation.
furszy Jan 21, 2022
bc9e8c2
RPC: Commit special transaction inside the wallet before relay it to …
furszy Jan 21, 2022
65b7816
Encapsulate SignTransaction inside the wallet class.
furszy Jan 21, 2022
2abcf4e
RPC: Move SignAndSendSpecialTx to specialtx_utils.h/cpp
furszy Jan 21, 2022
28fd55f
RPC: cleanup unneeded variable from parseProReg
furszy Jan 23, 2022
ade2216
chainparams: set v6.0 regtest activation height.
furszy Jan 24, 2022
11c0f34
Move ParsePubKeyIDFromAddress to specialtx_utils.h/cpp
furszy Jan 24, 2022
f55993b
GUI: implement basic create DMN process
furszy Jan 23, 2022
27c8d81
Create tiertwo interface, initializing and connecting the local DMNs …
furszy Jan 27, 2022
8081173
GUI: Connect known DMN to the MN screen
furszy Jan 28, 2022
bebc2cb
GUI: Add DMN PoSe banned start.
furszy Jan 31, 2022
2afe8b3
GUI: Generalize and simplify TooltipMenu
furszy Jan 31, 2022
9b03dd4
Store DMN operator sk within the dmn registration tx (if the key was …
furszy Jan 31, 2022
10856b7
GUI: Implement and connect owner "kill DMN" functionality.
furszy Jan 31, 2022
2a1a673
GUI: Implement and connect create DMN summary page
furszy Feb 1, 2022
597f888
GUI: Masternode creation wizard; generalize pages setup, next and bac…
furszy Feb 2, 2022
3a8ab8e
interfaces:tiertwo, implement isBlsPubKeyValid function.
furszy Feb 4, 2022
fa9a948
GUI: Masternode creation wizard dialog, create and connect owner and …
furszy Feb 4, 2022
0ad9d4b
GUI: add copy to clipboard action to DMN creation summary page
furszy Feb 7, 2022
063c103
GUI: add subtitle to masternode creation wizard summary page
furszy Feb 8, 2022
35bbe58
GUI: do not invalidate addresses filter when the new filter type is e…
furszy Feb 8, 2022
41df6ec
GUI: masternode creation wizard, connect dropdown list to owner addre…
furszy Feb 8, 2022
f77dc7b
interfaces::tiertwo, implement function to get single DMN data.
furszy Feb 8, 2022
19cc68f
GUI: Implement and connect MN information dialog for Deterministic Ma…
furszy Feb 8, 2022
19154cf
GUI: add export DMN functionality
furszy Feb 9, 2022
9a9271e
GUI: Masternode creation wizard; add voter customization page.
furszy Feb 17, 2022
e082151
GUI: Masternode creation wizard; connect custom voting key to the bac…
furszy Feb 18, 2022
d69289d
GUI: connect custom voting address to summary screen
furszy Feb 18, 2022
1af1a84
GUI: DMN creation, convert rejection error into an understandable str…
furszy Feb 19, 2022
8b02ee7
test: failing txs are now properly considered RPC_VERIFY_REJECTED and…
furszy Feb 21, 2022
bc31cf3
Add and connect function to validate the operator service
furszy Feb 21, 2022
c99f8d0
GUI: enable custom operator payout
furszy Feb 21, 2022
525af94
GUI, Voting dialog: filter out legacy MNs and DMNs that don't have th…
furszy Feb 21, 2022
50af2fb
GUI: MN wizard dialog text cut off correction.
furszy Feb 28, 2022
2be9d54
GUI: MN creation wizard, get default port number from the client model.
furszy Mar 1, 2022
326607a
test: extending base tier two MN network.
furszy Feb 27, 2022
2b60344
test: decouple budget functions from governance_sync test to a budget…
furszy Feb 27, 2022
8b758b1
test: implement single block payments budget test
furszy Feb 27, 2022
81b6d96
test: post-v6 enforcement, check coinstake output value
furszy Mar 3, 2022
c06de4a
Budget-Util: implement IsSuperBlock function
random-zebra Feb 4, 2022
b941d11
Refactor: decouple IsBlockPayeeValid/IsBlockValueValid from their legacy
random-zebra Feb 18, 2022
98a5424
Budget: Add function to check if ALL budgets are paid in a tx
random-zebra Feb 18, 2022
09d191e
BlockAssembler: pay all budgets (and masternode) in single SuperBlock
random-zebra Feb 18, 2022
61dda2b
Refactor: de-duplicate code with CBudgetManager::GetBestFinalizedBudget
random-zebra Feb 18, 2022
4a0e754
Validation: consider mn payment for superblocks in IsCoinbaseValueValid
random-zebra Feb 18, 2022
026606f
[SQUASH ME] Fixed std::map in CFinalizedBudget::AllBudgetsPaid
random-zebra Mar 3, 2022
0245001
[FIX] Don't use miner to receive budget proposals. Use an owner.
random-zebra Mar 3, 2022
aceb016
[FIX] last proposals check has not the first 2 proposals (they expired)
random-zebra Mar 3, 2022
c312124
[DON'T PICK] Modified pch message params
random-zebra Mar 3, 2022
ddd68cc
[DON'T PICK] Temp activation height v6 at block 624600
random-zebra Mar 3, 2022
0ed59b2
init: inform load tier two init error.
furszy Mar 7, 2022
ab9a4b6
init: don't error out if MN metadata db wasn't loaded properly.
furszy Mar 7, 2022
fec5ed3
fixup with export MN
furszy Mar 8, 2022
47354db
tiertwo: do not request list to already requested nodes.
furszy Mar 8, 2022
1119aa7
tiertwo: do not reset attempt and sync start time if the current sync…
furszy Mar 9, 2022
ad9dac2
tiertwo: log synchronization phases.
furszy Mar 9, 2022
09307c3
tiertwo: clear only sync requests
furszy Mar 9, 2022
c16095e
tiertwo: do not trigger a sync reset if we just finished syncing.
furszy Mar 9, 2022
d101262
validationinterface: trigger NotifyMasternodeListChanged asynchronously.
furszy Mar 9, 2022
d1d2796
Fixed two bugs, one of which halted the chain
panleone Jan 6, 2023
3b46b6b
Merge remote-tracking branch 'panleone/pivx_v6.0' into 2023_regtest_fix
Liquid369 Jan 6, 2023
1aed741
Fix GetMasternodePayment bad merge
Liquid369 Jan 7, 2023
0b735c0
Fix lint + dmn activation height
Liquid369 Jan 7, 2023
4ef2ff0
Fixed collateral spent on proregtx creation bug
panleone Jan 8, 2023
1f788dc
typo
panleone Jan 8, 2023
daa8680
Fix collateral used as input in ProRegTx
panleone Jan 8, 2023
391ef93
Slow down regtest
Liquid369 Jan 8, 2023
224a5fc
Regtest params adjust
Liquid369 Feb 3, 2023
83fdf1e
[Budget] Fix DMN Voting
Liquid369 Feb 4, 2023
84b0e29
Fixed DMN creation system: the collateral can now be included in the …
panleone Feb 4, 2023
1c130c2
Merge branch '2023_regtest_fix' of https://github.com/PIVX-Labs/PIVX …
panleone Feb 4, 2023
6dd881a
Forgot to uncomment
panleone Feb 4, 2023
235a189
Adjust budget cycles on regtest
Liquid369 Feb 6, 2023
e5a2789
Slow regtest down again
Liquid369 Feb 6, 2023
040567c
Adjust budget cycle on regtest
Liquid369 Feb 6, 2023
81335d8
Bump budgetcycleblocks
Liquid369 Feb 7, 2023
8156dae
Bump back Budget Cycle Blocks
Liquid369 Feb 8, 2023
9cd1521
Added possibility to POSE-UNBAN fom GUI
panleone Feb 8, 2023
112c1d6
Adjust finalization window for regtest too
Liquid369 Feb 8, 2023
841c9de
Added confirmation
panleone Feb 8, 2023
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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ set(SERVER_SOURCES
./src/tiertwo/init.cpp
./src/interfaces/handler.cpp
./src/interfaces/wallet.cpp
./src/interfaces/tiertwo.cpp
./src/dbwrapper.cpp
./src/legacy/validation_zerocoin_legacy.cpp
./src/mapport.cpp
Expand Down Expand Up @@ -417,6 +418,7 @@ set(COMMON_SOURCES
./src/evo/evodb.cpp
./src/evo/providertx.cpp
./src/evo/specialtx_validation.cpp
./src/evo/specialtx_utils.cpp
./src/llmq/quorums_blockprocessor.cpp
./src/llmq/quorums_commitment.cpp
./src/llmq/quorums_connections.cpp
Expand Down
4 changes: 4 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ BITCOIN_CORE_H = \
evo/evonotificationinterface.h \
evo/providertx.h \
evo/specialtx_validation.h \
evo/specialtx_utils.h \
flatdb.h \
llmq/quorums_blockprocessor.h \
llmq/quorums_commitment.h \
Expand All @@ -213,6 +214,7 @@ BITCOIN_CORE_H = \
init.h \
tiertwo/init.h \
interfaces/handler.h \
interfaces/tiertwo.h \
interfaces/wallet.h \
invalid.h \
invalid_outpoints.json.h \
Expand Down Expand Up @@ -367,6 +369,7 @@ libbitcoin_server_a_SOURCES = \
evo/mnauth.cpp \
evo/providertx.cpp \
evo/specialtx_validation.cpp \
evo/specialtx_utils.cpp \
llmq/quorums_blockprocessor.cpp \
llmq/quorums_commitment.cpp \
llmq/quorums_connections.cpp \
Expand Down Expand Up @@ -594,6 +597,7 @@ libbitcoin_util_a_SOURCES = \
compat/strnlen.cpp \
fs.cpp \
interfaces/handler.cpp \
interfaces/tiertwo.cpp \
logging.cpp \
random.cpp \
randomenv.cpp \
Expand Down
6 changes: 5 additions & 1 deletion src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ QT_MOC_CPP = \
qt/pivx/moc_furabstractlistitemdelegate.cpp \
qt/pivx/moc_receivedialog.cpp \
qt/pivx/moc_pfborderimage.cpp \
qt/pivx/moc_clickablelabel.cpp \
qt/pivx/moc_topbar.cpp \
qt/pivx/moc_txrow.cpp \
qt/pivx/moc_dashboardwidget.cpp \
Expand Down Expand Up @@ -275,7 +276,8 @@ BITCOIN_QT_H = \
qt/pivx/settings/settingswalletrepairwidget.h \
qt/pivx/settings/settingswidget.h \
qt/pivx/welcomecontentwidget.h \
qt/pivx/splash.h
qt/pivx/splash.h \
qt/pivx/clickablelabel.h

RES_ICONS = \
qt/res/icons/bitcoin.ico \
Expand Down Expand Up @@ -511,6 +513,8 @@ RES_ICONS = \
qt/pivx/res/img/ic-nav-governance-hover.svg \
qt/pivx/res/img/ic-time.svg \
qt/pivx/res/img/ic-link-hover.svg \
qt/pivx/res/img/ic-dmn.svg \
qt/pivx/res/img/ic-lmn.svg \
qt/pivx/res/img/img-empty-governance.svg \
qt/pivx/res/img/img-empty-dark-governance.svg

Expand Down
47 changes: 46 additions & 1 deletion src/budget/budgetmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "budget/budgetmanager.h"

#include "budget/budgetutil.h"
#include "consensus/validation.h"
#include "evo/deterministicmns.h"
#include "masternodeman.h"
Expand Down Expand Up @@ -113,7 +114,7 @@ uint256 CBudgetManager::SubmitFinalBudget()
// Submit final budget during the last 2 days (2880 blocks) before payment for Mainnet, about 9 minutes (9 blocks) for Testnet
int finalizationWindow = ((nBlocksPerCycle / 30) * 2);

if (Params().IsTestnet()) {
if (Params().IsTestnet() || Params().IsRegTestNet()) {
// NOTE: 9 blocks for testnet is way to short to have any masternode submit an automatic vote on the finalized(!) budget,
// because those votes are only submitted/relayed once every 56 blocks in CFinalizedBudget::AutoCheck()

Expand Down Expand Up @@ -510,6 +511,30 @@ bool CBudgetManager::GetExpectedPayeeAmount(int chainHeight, CAmount& nAmountRet
return GetPayeeAndAmount(chainHeight, payeeRet, nAmountRet);
}

const CFinalizedBudget* CBudgetManager::GetBestFinalizedBudget(int chainHeight) const
{
if (!IsSuperBlock(chainHeight)) {
return nullptr;
}
int nFivePercent = mnodeman.CountEnabled() / 20;

const auto highest = GetBudgetWithHighestVoteCount(chainHeight);
if (highest.m_budget_fin == nullptr || highest.m_vote_count <= nFivePercent) {
// No finalization or not enough votes.
return nullptr;
}
return highest.m_budget_fin;
}

CAmount CBudgetManager::GetFinalizedBudgetTotalPayout(int chainHeight) const
{
const CFinalizedBudget* pfb = GetBestFinalizedBudget(chainHeight);
if (pfb == nullptr) {
return 0;
}
return pfb->GetTotalPayout();
}

bool CBudgetManager::FillBlockPayee(CMutableTransaction& txCoinbase, CMutableTransaction& txCoinstake, const int nHeight, bool fProofOfStake) const
{
if (nHeight <= 0) return false;
Expand Down Expand Up @@ -553,6 +578,14 @@ bool CBudgetManager::FillBlockPayee(CMutableTransaction& txCoinbase, CMutableTra
return true;
}

void CBudgetManager::FillBlockPayees(CMutableTransaction& tx, int height) const
{
const CFinalizedBudget* pfb = GetBestFinalizedBudget(height);
if (pfb != nullptr) {
pfb->PayAllBudgets(tx);
}
}

void CBudgetManager::VoteOnFinalizedBudgets()
{
// function called only from initialized masternodes
Expand Down Expand Up @@ -742,6 +775,18 @@ TrxValidationStatus CBudgetManager::IsTransactionValid(const CTransaction& txNew
return fThreshold ? TrxValidationStatus::InValid : TrxValidationStatus::VoteThreshold;
}

bool CBudgetManager::IsValidSuperBlockTx(const CTransaction& txNew, int nBlockHeight) const
{
assert(IsSuperBlock(nBlockHeight));

const CFinalizedBudget* pfb = GetBestFinalizedBudget(nBlockHeight);
if (pfb == nullptr) {
// No finalization or not enough votes. Nothing to check.
return true;
}
return pfb->AllBudgetsPaid(txNew);
}

std::vector<CBudgetProposal*> CBudgetManager::GetAllProposalsOrdered()
{
LOCK(cs_proposals);
Expand Down
13 changes: 9 additions & 4 deletions src/budget/budgetmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,23 @@ class CBudgetManager : public CValidationInterface
std::vector<CBudgetProposal*> GetAllProposalsOrdered();
std::vector<CFinalizedBudget*> GetFinalizedBudgets();
bool GetExpectedPayeeAmount(int chainHeight, CAmount& nAmountRet) const;
bool IsBudgetPaymentBlock(int nBlockHeight) const;
bool IsBudgetPaymentBlock(int nBlockHeight, int& nCountThreshold) const;
CAmount GetFinalizedBudgetTotalPayout(int chainHeight) const;
bool IsBudgetPaymentBlock(int nBlockHeight) const; // legacy (multiple SB)
bool IsBudgetPaymentBlock(int nBlockHeight, int& nCountThreshold) const; // legacy (multiple SB)
bool AddProposal(CBudgetProposal& budgetProposal);
bool AddFinalizedBudget(CFinalizedBudget& finalizedBudget, CNode* pfrom = nullptr);
void ForceAddFinalizedBudget(const uint256& nHash, const uint256& feeTxId, const CFinalizedBudget& finalizedBudget);
uint256 SubmitFinalBudget();

bool UpdateProposal(const CBudgetVote& vote, CNode* pfrom, std::string& strError);
bool UpdateFinalizedBudget(const CFinalizedBudgetVote& vote, CNode* pfrom, std::string& strError);
TrxValidationStatus IsTransactionValid(const CTransaction& txNew, const uint256& nBlockHash, int nBlockHeight) const;
TrxValidationStatus IsTransactionValid(const CTransaction& txNew, const uint256& nBlockHash, int nBlockHeight) const; // legacy (multiple SB)
bool IsValidSuperBlockTx(const CTransaction& txNew, int nBlockHeight) const; // v6.0: single SB

std::string GetRequiredPaymentsString(int nBlockHeight);
bool FillBlockPayee(CMutableTransaction& txCoinbase, CMutableTransaction& txCoinstake, const int nHeight, bool fProofOfStake) const;
const CFinalizedBudget* GetBestFinalizedBudget(int chainHeight) const;
bool FillBlockPayee(CMutableTransaction& txCoinbase, CMutableTransaction& txCoinstake, const int nHeight, bool fProofOfStake) const; // legacy (multiple SB)
void FillBlockPayees(CMutableTransaction& tx, int height) const; // v6.0: single SB

// Only initialized masternodes: sign and submit votes on valid finalized budgets
void VoteOnFinalizedBudgets();
Expand Down
5 changes: 3 additions & 2 deletions src/budget/budgetproposal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "budget/budgetproposal.h"

#include "budget/budgetutil.h"
#include "chainparams.h"
#include "script/standard.h"
#include "utilstrencodings.h"
Expand Down Expand Up @@ -86,8 +88,7 @@ bool CBudgetProposal::IsHeavilyDownvoted(int mnCount)
bool CBudgetProposal::CheckStartEnd()
{
// block start must be a superblock
if (nBlockStart < 0 ||
nBlockStart % Params().GetConsensus().nBudgetCycleBlocks != 0) {
if (nBlockStart < 0 || !IsSuperBlock(nBlockStart)) {
strInvalid = "Invalid nBlockStart";
return false;
}
Expand Down
8 changes: 7 additions & 1 deletion src/budget/budgetutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "budget/budgetutil.h"

#include "chainparams.h"
#include "budget/budgetmanager.h"
#include "masternodeman.h"
#include "masternodeconfig.h"
Expand Down Expand Up @@ -269,4 +270,9 @@ UniValue mnLocalBudgetVoteInner(bool fLegacyMN, const uint256& budgetHash, bool

return (fFinal ? voteFinalBudget(budgetHash, mnKeys, resultsObj, 0)
: voteProposal(budgetHash, nVote, mnKeys, resultsObj, 0));
}
}

bool IsSuperBlock(int height)
{
return height % Params().GetConsensus().nBudgetCycleBlocks == 0;
}
3 changes: 3 additions & 0 deletions src/budget/budgetutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ UniValue mnLocalBudgetVoteInner(bool fLegacyMN, const uint256& budgetHash, bool
UniValue mnBudgetVoteInner(CWallet* const pwallet, bool fLegacyMN, const uint256& budgetHash, bool fFinal,
const CBudgetVote::VoteDirection& nVote, const Optional<std::string>& mnAliasFilter);

// One every Consensus::Params:nBudgetCycleBlocks blocks
bool IsSuperBlock(int height);

#endif //PIVX_BUDGETUTIL_H
43 changes: 42 additions & 1 deletion src/budget/finalizedbudget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

#include "budget/finalizedbudget.h"

#include "budget/budgetutil.h"
#include "masternodeman.h"
#include "utilmoneystr.h"
#include "validation.h"

CFinalizedBudget::CFinalizedBudget() :
Expand Down Expand Up @@ -187,7 +189,7 @@ bool CFinalizedBudget::CheckStartEnd()
}

// Must be the correct block for payment to happen (once a month)
if (nBlockStart % Params().GetConsensus().nBudgetCycleBlocks != 0) {
if (!IsSuperBlock(nBlockStart)) {
strInvalid = "Invalid BlockStart";
return false;
}
Expand Down Expand Up @@ -389,6 +391,45 @@ bool CFinalizedBudget::GetPayeeAndAmount(int64_t nBlockHeight, CScript& payee, C
return true;
}

bool CFinalizedBudget::AllBudgetsPaid(const CTransaction& tx) const
{
// make a map for faster lookup and deal with duplicate payees
struct cmp {
bool operator()(const CTxOut& a, const CTxOut& b) const {
return a.scriptPubKey < b.scriptPubKey ||
(a.scriptPubKey == b.scriptPubKey && a.nValue < b.nValue);
}
};
std::map<CTxOut, int, cmp> txouts;
for (const CTxOut& o: tx.vout) {
txouts[o]++;
}

for (const CTxBudgetPayment& payment : vecBudgetPayments) {
const auto it = txouts.find(CTxOut(payment.nAmount, payment.payee));
if (it == txouts.end() || it->second == 0) {
// Payment not found
CTxDestination addr;
const std::string& payee = ExtractDestination(payment.payee, addr) ? EncodeDestination(addr)
: HexStr(payment.payee);
LogPrint(BCLog::MNBUDGET, "Missing payment of %s for %s (proposal hash: %s)\n",
FormatMoney(payment.nAmount), payee, payment.nProposalHash.ToString());
return false;
}
it->second--;
}

// all budgets are paid by tx
return true;
}

void CFinalizedBudget::PayAllBudgets(CMutableTransaction& tx) const
{
for (const CTxBudgetPayment& payment : vecBudgetPayments) {
tx.vout.emplace_back(payment.nAmount, payment.payee);
}
}

// return broadcast serialization
CDataStream CFinalizedBudget::GetBroadcast() const
{
Expand Down
6 changes: 6 additions & 0 deletions src/budget/finalizedbudget.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ class CFinalizedBudget
bool GetBudgetPaymentByBlock(int64_t nBlockHeight, CTxBudgetPayment& payment) const;
bool GetPayeeAndAmount(int64_t nBlockHeight, CScript& payee, CAmount& nAmount) const;

// Check if ALL the budgets are paid by transaction tx
bool AllBudgetsPaid(const CTransaction& tx) const;

// Add payments for ALL budgets to tx outs
void PayAllBudgets(CMutableTransaction& tx) const;

// Check finalized budget proposals. Masternodes only (when voting on finalized budgets)
bool CheckProposals(const std::map<uint256, CBudgetProposal>& mapWinningProposals) const;
// Total amount paid out by this budget
Expand Down
21 changes: 10 additions & 11 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,10 @@ class CTestNetParams : public CChainParams
* The characters are rarely used upper ASCII, not valid as UTF-8, and produce
* a large 4-byte int at any alignment.
*/
pchMessageStart[0] = 0xf5;
pchMessageStart[1] = 0xe6;
pchMessageStart[2] = 0xd5;
pchMessageStart[3] = 0xca;
pchMessageStart[0] = 0xe5;
pchMessageStart[1] = 0xd1;
pchMessageStart[2] = 0xd4;
pchMessageStart[3] = 0xea;
nDefaultPort = 51474;

// nodes with support for servicebits filtering should be at the top
Expand Down Expand Up @@ -582,22 +582,21 @@ class CRegTestParams : public CChainParams
Consensus::NetworkUpgrade::ALWAYS_ACTIVE;
consensus.vUpgrades[Consensus::UPGRADE_TESTDUMMY].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_POS].nActivationHeight = 251;
consensus.vUpgrades[Consensus::UPGRADE_POS_V2].nActivationHeight = 251;
consensus.vUpgrades[Consensus::UPGRADE_POS].nActivationHeight = 298;
consensus.vUpgrades[Consensus::UPGRADE_POS_V2].nActivationHeight = 298;
consensus.vUpgrades[Consensus::UPGRADE_ZC].nActivationHeight = 300;
consensus.vUpgrades[Consensus::UPGRADE_ZC_V2].nActivationHeight = 300;
consensus.vUpgrades[Consensus::UPGRADE_BIP65].nActivationHeight =
Consensus::NetworkUpgrade::ALWAYS_ACTIVE;
consensus.vUpgrades[Consensus::UPGRADE_ZC_PUBLIC].nActivationHeight = 400;
consensus.vUpgrades[Consensus::UPGRADE_V3_4].nActivationHeight = 251;
consensus.vUpgrades[Consensus::UPGRADE_V3_4].nActivationHeight = 298;
consensus.vUpgrades[Consensus::UPGRADE_V4_0].nActivationHeight =
Consensus::NetworkUpgrade::ALWAYS_ACTIVE;
consensus.vUpgrades[Consensus::UPGRADE_V5_0].nActivationHeight = 300;
consensus.vUpgrades[Consensus::UPGRADE_V5_2].nActivationHeight = 300;
consensus.vUpgrades[Consensus::UPGRADE_V5_3].nActivationHeight = 251;
consensus.vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight = 576;
consensus.vUpgrades[Consensus::UPGRADE_V6_0].nActivationHeight =
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_V5_3].nActivationHeight = 298;
consensus.vUpgrades[Consensus::UPGRADE_V5_5].nActivationHeight = 301;
consensus.vUpgrades[Consensus::UPGRADE_V6_0].nActivationHeight = 301;

/**
* The message start string is designed to be unlikely to occur in normal data.
Expand Down
2 changes: 1 addition & 1 deletion src/destination_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Destination& Destination::operator=(const Destination& from)
}

// Returns the key ID if Destination is a transparent "regular" destination
const CKeyID* Destination::getKeyID()
const CKeyID* Destination::getKeyID() const
{
const CTxDestination* regDest = Standard::GetTransparentDestination(dest);
return (regDest) ? boost::get<CKeyID>(regDest) : nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/destination_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Destination {

Destination& operator=(const Destination& from);
// Returns the key ID if Destination is a transparent "regular" destination
const CKeyID* getKeyID();
const CKeyID* getKeyID() const;
// Returns the encoded string address
std::string ToString() const;
};
Expand Down
3 changes: 2 additions & 1 deletion src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "bls/key_io.h"
#include "chain.h"
#include "coins.h"
#include "chainparams.h"
#include "consensus/upgrades.h"
#include "consensus/validation.h"
Expand Down Expand Up @@ -505,6 +504,7 @@ bool CDeterministicMNManager::ProcessBlock(const CBlock& block, const CBlockInde
}

diff.nHeight = pindex->nHeight;
diff.blockHash = pindex->GetBlockHash();
mnListDiffsCache.emplace(pindex->GetBlockHash(), diff);
} catch (const std::exception& e) {
LogPrintf("CDeterministicMNManager::%s -- internal error: %s\n", __func__, e.what());
Expand Down Expand Up @@ -888,6 +888,7 @@ CDeterministicMNList CDeterministicMNManager::GetListForBlock(const CBlockIndex*
}

diff.nHeight = pindex->nHeight;
diff.blockHash = pindex->GetBlockHash();
mnListDiffsCache.emplace(pindex->GetBlockHash(), std::move(diff));
listDiffIndexes.emplace_front(pindex);
pindex = pindex->pprev;
Expand Down
Loading