Skip to content

Commit 9a8c5ac

Browse files
authored
Merge pull request #6 from CryptoCoderz/master
DigitalNote v1.0.1.2 Release
2 parents aedeb9f + 9d302be commit 9a8c5ac

File tree

8 files changed

+47
-29
lines changed

8 files changed

+47
-29
lines changed

DigitalNote.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
TEMPLATE = app
22
TARGET = DigitalNote-qt
3-
VERSION = 1.0.1.1
3+
VERSION = 1.0.1.2
44
INCLUDEPATH += src src/json src/qt src/qt/plugins/mrichtexteditor
55
QT += core gui widgets network printsupport
66
DEFINES += ENABLE_WALLET

src/blockparams.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ unsigned int VRX_Retarget(const CBlockIndex* pindexLast, bool fProofOfStake)
316316
return bnVelocity.GetCompact(); // can't index prevblock
317317

318318
// Live fork toggle diff reset
319-
if(nLiveForkToggle > 0)
319+
if(pindexLast->GetBlockTime() > 0)
320320
{
321-
if(pindexLast->nHeight > nLiveForkToggle) // Selectable toggle
321+
if(pindexLast->GetBlockTime() > nPaymentUpdate_1) // Monday, May 20, 2019 12:00:00 AM
322322
{
323-
if(pindexLast->nHeight < nLiveForkToggle+5) {
323+
if(pindexLast->GetBlockTime() < nPaymentUpdate_1+480) {
324324
return bnVelocity.GetCompact(); // diff reset
325325
}
326326
}
@@ -541,9 +541,9 @@ int64_t GetMasternodePayment(int nHeight, int64_t blockValue)
541541
// Set calculated position of seesaw arc
542542
retDouble = swingSubsidy * seesawBase;
543543
// v1.1 payment subsidy patch
544-
if(nLiveForkToggle > 0)
544+
if(pindexBest->GetBlockTime() > 0)
545545
{
546-
if(pindexBest->nHeight > nLiveForkToggle) // Selectable toggle
546+
if(pindexBest->GetBlockTime() > nPaymentUpdate_1) // Monday, May 20, 2019 12:00:00 AM
547547
{
548548
// set returned value to calculated value
549549
ret = retDouble;

src/clientversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define CLIENT_VERSION_MAJOR 1
1010
#define CLIENT_VERSION_MINOR 0
1111
#define CLIENT_VERSION_REVISION 1
12-
#define CLIENT_VERSION_BUILD 1
12+
#define CLIENT_VERSION_BUILD 2
1313

1414
// Set to true for release, false for prerelease or test build
1515
#define CLIENT_VERSION_IS_RELEASE true

src/fork.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/** Reserve Phase start block */
1212
static const int64_t nReservePhaseStart = 1;
13+
/** Masternode/Devops Payment Update 1 **/
14+
static const int64_t nPaymentUpdate_1 = 1558310400;
1315
/** Velocity toggle block */
1416
static const int64_t VELOCITY_TOGGLE = 175; // Implementation of the Velocity system into the chain.
1517
/** Velocity retarget toggle block */

src/main.cpp

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2605,10 +2605,10 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig) c
26052605
bDevOpsPayment = false;
26062606
}
26072607
}
2608-
// Live fork toggle for upgrade testing
2609-
if(nLiveForkToggle > 0)
2608+
// Fork toggle for payment upgrade
2609+
if(pindexBest->GetBlockTime() > 0)
26102610
{
2611-
if(pindexBest->nHeight > nLiveForkToggle)
2611+
if(pindexBest->GetBlockTime() > nPaymentUpdate_1) // Monday, May 20, 2019 12:00:00 AM
26122612
{
26132613
bDevOpsPayment = true;
26142614
}
@@ -2621,7 +2621,7 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig) c
26212621
{
26222622
bDevOpsPayment = false;
26232623
}
2624-
// TODO: verify upgrade
2624+
// Run checks if at fork height
26252625
if(bDevOpsPayment)
26262626
{
26272627
int64_t nStandardPayment = 0;
@@ -2710,7 +2710,7 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig) c
27102710
if (mnodeman.IsPayeeAValidMasternode(rawPayee)) {
27112711
LogPrintf("CheckBlock() : PoW Recipient masternode address validity succesfully verified\n");
27122712
} else if (addressOut.ToString() == Params().DevOpsAddress()) {
2713-
LogPrintf("CheckBlock() : PoS Recipient masternode address validity succesfully verified\n");
2713+
LogPrintf("CheckBlock() : PoW Recipient masternode address validity succesfully verified\n");
27142714
} else {
27152715
LogPrintf("CheckBlock() : PoW Recipient masternode address validity could not be verified\n");
27162716
fBlockHasPayments = false;
@@ -3728,12 +3728,22 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
37283728
CAddress addrFrom;
37293729
uint64_t nNonce = 1;
37303730
vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;
3731-
if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
3731+
if(pfrom->nVersion <= (PROTOCOL_VERSION - 1))
37323732
{
3733-
// disconnect from peers older than this proto version
3734-
LogPrintf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString(), pfrom->nVersion);
3735-
pfrom->fDisconnect = true;
3736-
return false;
3733+
if(pindexBest->GetBlockTime() > HRD_LEGACY_CUTOFF)
3734+
{
3735+
// disconnect from peers older than legacy cutoff allows : Disconnect message 02
3736+
LogPrintf("partner %s using obsolete version %i; disconnecting DCM:02\n", pfrom->addr.ToString(), pfrom->nVersion);
3737+
pfrom->fDisconnect = true;
3738+
return false;
3739+
}
3740+
else if(pfrom->nVersion < MIN_PEER_PROTO_VERSION)
3741+
{
3742+
// disconnect from peers older than this proto version : Disconnect message 01
3743+
LogPrintf("partner %s using obsolete version %i; disconnecting DCM:01\n", pfrom->addr.ToString(), pfrom->nVersion);
3744+
pfrom->fDisconnect = true;
3745+
return false;
3746+
}
37373747
}
37383748

37393749
if (pfrom->nVersion == 10300)

src/miner.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ CBlock* CreateNewBlock(CReserveKey& reservekey, bool fProofOfStake, int64_t* pFe
371371
if (!fProofOfStake){
372372
pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(pindexPrev->nHeight + 1, nFees);
373373

374-
// TODO: Verify upgrade
375-
if(nLiveForkToggle > 0){
376-
if(pindexPrev->nHeight + 1 > nLiveForkToggle){
374+
// Check for payment update fork
375+
if(pindexBest->GetBlockTime() > 0){
376+
if(pindexBest->GetBlockTime() > nPaymentUpdate_1){ // Monday, May 20, 2019 12:00:00 AM
377377
// masternode/devops payment
378378
int64_t blockReward = GetProofOfWorkReward(pindexPrev->nHeight + 1, nFees);
379379
bool hasPayment = true;

src/rpcmining.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,9 +675,9 @@ Value getblocktemplate(const Array& params, bool fHelp)
675675
result.push_back(Pair("votes", aVotes));
676676

677677
// TODO: Verify upgrade
678-
if (nLiveForkToggle > 0)
678+
if (pindexBest->GetBlockTime() > 0)
679679
{
680-
if (pindexBest->nHeight > nLiveForkToggle)
680+
if (pindexBest->GetBlockTime() > nPaymentUpdate_1) // Monday, May 20, 2019 12:00:00 AM
681681
{
682682
// Set Masternode / DevOps payments
683683
int64_t masternodePayment = GetMasternodePayment(pindexPrev->nHeight+1, (int64_t)pblock->vtx[0].vout[0].nValue);

src/version.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,37 @@ static const int DATABASE_VERSION = 70509;
3030
//
3131
// network protocol versioning
3232
//
33-
static const int PROTOCOL_VERSION = 62008;
33+
static const int PROTOCOL_VERSION = 62009;
3434

3535
// intial proto version, to be increased after version/verack negotiation
3636
static const int INIT_PROTO_VERSION = 209;
3737

3838
// disconnect from peers older than this proto version
39-
static const int MIN_PEER_PROTO_VERSION = 62005;
39+
static const int MIN_PEER_PROTO_VERSION = 62007;
4040

4141
// minimum peer version accepted by MNenginePool
42-
static const int MIN_POOL_PEER_PROTO_VERSION = 62005;
43-
static const int MIN_INSTANTX_PROTO_VERSION = 62005;
42+
static const int MIN_POOL_PEER_PROTO_VERSION = 62007;
43+
static const int MIN_INSTANTX_PROTO_VERSION = 62007;
4444

4545
//! minimum peer version that can receive masternode payments
4646
// V1 - Last protocol version before update
4747
// V2 - Newest protocol version
48-
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 62005;
49-
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 62005;
48+
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 62007;
49+
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 62007;
5050

5151
// nTime field added to CAddress, starting with this version;
5252
// if possible, avoid requesting addresses nodes older than this
5353
static const int CADDR_TIME_VERSION = 31402;
5454

5555
// only request blocks from nodes outside this range of versions
5656
static const int NOBLKS_VERSION_START = 0;
57-
static const int NOBLKS_VERSION_END = 62004;
57+
static const int NOBLKS_VERSION_END = 62006;
58+
59+
// hard cutoff time for legacy network connections
60+
static const int64_t HRD_LEGACY_CUTOFF = 1558310400; // ON (Monday, May 20, 2019 12:00:00 AM)
61+
62+
// hard cutoff time for future network connections
63+
static const int64_t HRD_FUTURE_CUTOFF = 9993058800; // OFF (NOT TOGGLED)
5864

5965
// BIP 0031, pong message, is enabled for all versions AFTER this one
6066
static const int BIP0031_VERSION = 60000;

0 commit comments

Comments
 (0)