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
2 changes: 1 addition & 1 deletion DigitalNote.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = DigitalNote-qt
VERSION = 1.0.1.1
VERSION = 1.0.1.2
INCLUDEPATH += src src/json src/qt src/qt/plugins/mrichtexteditor
QT += core gui widgets network printsupport
DEFINES += ENABLE_WALLET
Expand Down
10 changes: 5 additions & 5 deletions src/blockparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,11 @@ unsigned int VRX_Retarget(const CBlockIndex* pindexLast, bool fProofOfStake)
return bnVelocity.GetCompact(); // can't index prevblock

// Live fork toggle diff reset
if(nLiveForkToggle > 0)
if(pindexLast->GetBlockTime() > 0)
{
if(pindexLast->nHeight > nLiveForkToggle) // Selectable toggle
if(pindexLast->GetBlockTime() > nPaymentUpdate_1) // Monday, May 20, 2019 12:00:00 AM
{
if(pindexLast->nHeight < nLiveForkToggle+5) {
if(pindexLast->GetBlockTime() < nPaymentUpdate_1+480) {
return bnVelocity.GetCompact(); // diff reset
}
}
Expand Down Expand Up @@ -541,9 +541,9 @@ int64_t GetMasternodePayment(int nHeight, int64_t blockValue)
// Set calculated position of seesaw arc
retDouble = swingSubsidy * seesawBase;
// v1.1 payment subsidy patch
if(nLiveForkToggle > 0)
if(pindexBest->GetBlockTime() > 0)
{
if(pindexBest->nHeight > nLiveForkToggle) // Selectable toggle
if(pindexBest->GetBlockTime() > nPaymentUpdate_1) // Monday, May 20, 2019 12:00:00 AM
{
// set returned value to calculated value
ret = retDouble;
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 1
#define CLIENT_VERSION_BUILD 2

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
2 changes: 2 additions & 0 deletions src/fork.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

/** Reserve Phase start block */
static const int64_t nReservePhaseStart = 1;
/** Masternode/Devops Payment Update 1 **/
static const int64_t nPaymentUpdate_1 = 1558310400;
/** Velocity toggle block */
static const int64_t VELOCITY_TOGGLE = 175; // Implementation of the Velocity system into the chain.
/** Velocity retarget toggle block */
Expand Down
30 changes: 20 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2605,10 +2605,10 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig) c
bDevOpsPayment = false;
}
}
// Live fork toggle for upgrade testing
if(nLiveForkToggle > 0)
// Fork toggle for payment upgrade
if(pindexBest->GetBlockTime() > 0)
{
if(pindexBest->nHeight > nLiveForkToggle)
if(pindexBest->GetBlockTime() > nPaymentUpdate_1) // Monday, May 20, 2019 12:00:00 AM
{
bDevOpsPayment = true;
}
Expand All @@ -2621,7 +2621,7 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig) c
{
bDevOpsPayment = false;
}
// TODO: verify upgrade
// Run checks if at fork height
if(bDevOpsPayment)
{
int64_t nStandardPayment = 0;
Expand Down Expand Up @@ -2710,7 +2710,7 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig) c
if (mnodeman.IsPayeeAValidMasternode(rawPayee)) {
LogPrintf("CheckBlock() : PoW Recipient masternode address validity succesfully verified\n");
} else if (addressOut.ToString() == Params().DevOpsAddress()) {
LogPrintf("CheckBlock() : PoS Recipient masternode address validity succesfully verified\n");
LogPrintf("CheckBlock() : PoW Recipient masternode address validity succesfully verified\n");
} else {
LogPrintf("CheckBlock() : PoW Recipient masternode address validity could not be verified\n");
fBlockHasPayments = false;
Expand Down Expand Up @@ -3728,12 +3728,22 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CAddress addrFrom;
uint64_t nNonce = 1;
vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;
if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
if(pfrom->nVersion <= (PROTOCOL_VERSION - 1))
{
// disconnect from peers older than this proto version
LogPrintf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString(), pfrom->nVersion);
pfrom->fDisconnect = true;
return false;
if(pindexBest->GetBlockTime() > HRD_LEGACY_CUTOFF)
{
// disconnect from peers older than legacy cutoff allows : Disconnect message 02
LogPrintf("partner %s using obsolete version %i; disconnecting DCM:02\n", pfrom->addr.ToString(), pfrom->nVersion);
pfrom->fDisconnect = true;
return false;
}
else if(pfrom->nVersion < MIN_PEER_PROTO_VERSION)
{
// disconnect from peers older than this proto version : Disconnect message 01
LogPrintf("partner %s using obsolete version %i; disconnecting DCM:01\n", pfrom->addr.ToString(), pfrom->nVersion);
pfrom->fDisconnect = true;
return false;
}
}

if (pfrom->nVersion == 10300)
Expand Down
6 changes: 3 additions & 3 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,9 @@ CBlock* CreateNewBlock(CReserveKey& reservekey, bool fProofOfStake, int64_t* pFe
if (!fProofOfStake){
pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(pindexPrev->nHeight + 1, nFees);

// TODO: Verify upgrade
if(nLiveForkToggle > 0){
if(pindexPrev->nHeight + 1 > nLiveForkToggle){
// Check for payment update fork
if(pindexBest->GetBlockTime() > 0){
if(pindexBest->GetBlockTime() > nPaymentUpdate_1){ // Monday, May 20, 2019 12:00:00 AM
// masternode/devops payment
int64_t blockReward = GetProofOfWorkReward(pindexPrev->nHeight + 1, nFees);
bool hasPayment = true;
Expand Down
4 changes: 2 additions & 2 deletions src/rpcmining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,9 @@ Value getblocktemplate(const Array& params, bool fHelp)
result.push_back(Pair("votes", aVotes));

// TODO: Verify upgrade
if (nLiveForkToggle > 0)
if (pindexBest->GetBlockTime() > 0)
{
if (pindexBest->nHeight > nLiveForkToggle)
if (pindexBest->GetBlockTime() > nPaymentUpdate_1) // Monday, May 20, 2019 12:00:00 AM
{
// Set Masternode / DevOps payments
int64_t masternodePayment = GetMasternodePayment(pindexPrev->nHeight+1, (int64_t)pblock->vtx[0].vout[0].nValue);
Expand Down
20 changes: 13 additions & 7 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,37 @@ static const int DATABASE_VERSION = 70509;
//
// network protocol versioning
//
static const int PROTOCOL_VERSION = 62008;
static const int PROTOCOL_VERSION = 62009;

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

// disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION = 62005;
static const int MIN_PEER_PROTO_VERSION = 62007;

// minimum peer version accepted by MNenginePool
static const int MIN_POOL_PEER_PROTO_VERSION = 62005;
static const int MIN_INSTANTX_PROTO_VERSION = 62005;
static const int MIN_POOL_PEER_PROTO_VERSION = 62007;
static const int MIN_INSTANTX_PROTO_VERSION = 62007;

//! minimum peer version that can receive masternode payments
// V1 - Last protocol version before update
// V2 - Newest protocol version
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 62005;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 62005;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 62007;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 62007;

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

// only request blocks from nodes outside this range of versions
static const int NOBLKS_VERSION_START = 0;
static const int NOBLKS_VERSION_END = 62004;
static const int NOBLKS_VERSION_END = 62006;

// hard cutoff time for legacy network connections
static const int64_t HRD_LEGACY_CUTOFF = 1558310400; // ON (Monday, May 20, 2019 12:00:00 AM)

// hard cutoff time for future network connections
static const int64_t HRD_FUTURE_CUTOFF = 9993058800; // OFF (NOT TOGGLED)

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