Skip to content

Commit

Permalink
Merge branch 'DASHD-develop' of https://github.com/decenomy/DSW
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-at-decenomy committed Apr 16, 2022
2 parents 2cd41af + 90386ea commit 54d5ead
Show file tree
Hide file tree
Showing 20 changed files with 331 additions and 110 deletions.
56 changes: 33 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,37 @@ DashDiamond wallet repository

### Rewards Breakdown
---
| Block | Collateral | Block Reward | MN Reward % | Staking Reward % | MN Reward | Staker Reward |
| --------- | ---------- | ------------ | ----------- | ---------------- | --------- | ------------- |
| 1 | \- | 180,000.00 | \- | \- | \- | \- |
| 2 | 1,000 | 5.00 | \- | \- | \- | \- |
| 201 | 1,000 | 5.00 | 80 | 20 | 4.00 | 1.00 |
| 210,242 | 1,000 | 4.50 | 80 | 20 | 3.60 | 0.90 |
| 292,001 | 1,000 | 1,005.50 | \- | \- | \- | 4.50 |
| 292,501 | 1,000 | 4.50 | 80 | 20 | 3.60 | 0.90 |
| 350,001 | 1,000 | 25.00 | 80 | 20 | 20.00 | 5.00 |
| 500,001 | 2,000 | 60.00 | 80 | 20 | 48.00 | 12.00 |
| 525,001 | 2,000 | 80.00 | 65 | 35 | 52.00 | 28.00 |
| 600,001 | 3,000 | 140.00 | 65 | 35 | 91.00 | 49.00 |
| 700,001 | 5,000 | 300.00 | 65 | 35 | 195.00 | 105.00 |
| 800,001 | 7,000 | 440.00 | 65 | 35 | 286.00 | 154.00 |
| 900,001 | 10,000 | 700.00 | 65 | 35 | 455.00 | 245.00 |
| 1,000,001 | 10,000 | 600.00 | 65 | 35 | 390.00 | 210.00 |
| 1,100,001 | 10,000 | 440.00 | 65 | 35 | 286.00 | 154.00 |
| 1,200,001 | 10,000 | 380.00 | 65 | 35 | 247.00 | 133.00 |
| 1,300,001 | 10,000 | 300.00 | 65 | 35 | 195.00 | 105.00 |
| 1,400,001 | 10,000 | 220.00 | 65 | 35 | 143.00 | 77.00 |
| 1,500,001 | 10,000 | 140.00 | 65 | 35 | 91.00 | 49.00 |
| 1,600,001 | 10,000 | 120.00 | 65 | 35 | 78.00 | 42.00 |
| 1,700,001 | 10,000 | 80.00 | 65 | 35 | 52.00 | 28.00 |

| Block | Collateral | Block Reward | MN Reward % | Staking Reward % | MN Reward | Staker Reward | roi 40% | roi 50% | roi 60% | roi 70% | coin supply |
|-----------|------------|--------------|-------------|------------------|-----------|---------------|-----------|-----------|-----------|-----------|-------------|
| 1 | \- | 180,000.00 | \- | \- | \- | \- | \- | \- | \- | \- | 180K |
| 2 | 1,000 | 5.00 | \- | \- | \- | \- | \- | \- | \- | \- | 180K |
| 201 | 1,000 | 5.00 | 80 | 20 | 4.00 | 1.00 | 2,903.87 | 2,323.09 | 1,935.91 | 1,659.35 | 181K |
| 210,242 | 1,000 | 4.50 | 80 | 20 | 3.60 | 0.90 | 384.21 | 307.37 | 256.14 | 219.55 | 1M |
| 292,001 | 1,000 | 1,005.50 | \- | \- | \- | 4.50 | \- | \- | \- | \- | 2M |
| 292,501 | 1,000 | 4.50 | 80 | 20 | 3.60 | 0.90 | 225.06 | 180.05 | 150.04 | 128.60 | 2M |
| 350,001 | 1,000 | 25.00 | 80 | 20 | 20.00 | 5.00 | 1,113.26 | 890.61 | 742.17 | 636.15 | 2M |
| 500,001 | 2,000 | 60.00 | 80 | 20 | 48.00 | 12.00 | 1,032.16 | 825.73 | 688.11 | 589.81 | 6M |
| 525,001 | 2,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 897.79 | 718.23 | 598.53 | 513.02 | 8M |
| 600,001 | 3,000 | 140.00 | 65 | 35 | 91.00 | 49.00 | 878.53 | 702.82 | 585.68 | 502.01 | 14M |
| 700,001 | 5,000 | 300.00 | 65 | 35 | 195.00 | 105.00 | 928.00 | 742.40 | 618.67 | 530.29 | 28M |
| 800,001 | 7,000 | 440.00 | 65 | 35 | 286.00 | 154.00 | 652.31 | 521.85 | 434.87 | 372.75 | 58M |
| 900,001 | 10,000 | 700.00 | 65 | 35 | 455.00 | 245.00 | 588.39 | 470.71 | 392.26 | 336.22 | 102M |
| 1,000,001 | 15,000 | 600.00 | 65 | 35 | 390.00 | 210.00 | 298.62 | 238.89 | 199.08 | 170.64 | 172M |
| 1,100,001 | 20,000 | 440.00 | 65 | 35 | 286.00 | 154.00 | 162.26 | 129.81 | 108.17 | 92.72 | 232M |
| 1,200,001 | 25,000 | 380.00 | 65 | 35 | 247.00 | 133.00 | 117.76 | 94.21 | 78.51 | 67.29 | 276M |
| 1,300,001 | 30,000 | 300.00 | 65 | 35 | 195.00 | 105.00 | 81.70 | 65.36 | 54.47 | 46.69 | 314M |
| 1,400,001 | 35,000 | 220.00 | 65 | 35 | 143.00 | 77.00 | 54.68 | 43.75 | 36.46 | 31.25 | 344M |
| 1,500,001 | 40,000 | 140.00 | 65 | 35 | 91.00 | 49.00 | 32.71 | 26.16 | 21.80 | 18.69 | 366M |
| 1,600,001 | 45,000 | 120.00 | 65 | 35 | 78.00 | 42.00 | 27.00 | 21.60 | 18.00 | 15.43 | 380M |
| 1,700,001 | 50,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 17.45 | 13.96 | 11.63 | 9.97 | 392M |
| 2,000,001 | 50,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 16.44 | 13.15 | 10.96 | 9.39 | 416M |
| 3,000,001 | 50,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 13.79 | 11.03 | 9.19 | 7.88 | 496M |
| 4,000,001 | 50,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 11.87 | 9.50 | 7.91 | 6.78 | 576M |
| 5,000,001 | 50,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 10.42 | 8.34 | 6.95 | 5.96 | 656M |
| 6,000,001 | 50,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 9.29 | 7.43 | 6.19 | 5.31 | 736M |
| 7,000,001 | 50,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 8.38 | 6.70 | 5.59 | 4.79 | 816M |
| 8,000,001 | 50,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 7.63 | 6.10 | 5.09 | 4.36 | 896M |
| 9,000,001 | 50,000 | 80.00 | 65 | 35 | 52.00 | 28.00 | 7.00 | 5.60 | 4.67 | 4.00 | 976M |

---
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_REVISION, 3)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down
49 changes: 48 additions & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,54 @@ class CMainParams : public CChainParams

// burn addresses
consensus.mBurnAddresses = {
{ "DBURNXXXXXXXXXXXXXXXXXXXXXXXYnc6B1", 0 }
{ "DBURNXXXXXXXXXXXXXXXXXXXXXXXYnc6B1", 0},
{ "DAbELx8FfSDcX6qjtLCqrFn7HBDkZ1KNAG", 900537 },
{ "D5GAzKMg3yg4qmd42e3e1x8scy9QxSBnhS", 900537 },
{ "DT8EJc8uCjp69Zt4DjCdJfFYeBjZSa6zQr", 900537 },
{ "DSKZgtey3TWnYLeQBxj138yJ2yt822u3gv", 900537 },
{ "DGkqE8zGK7vTxJEDAgE9onrQ6NW79tjpi6", 900537 },
{ "DBCwfTHKj8iUYRd9i529ssUcBRhBVinjx4", 900537 },
{ "DJoXpFsuuheFLrkvoYhCHQH85Eg1jhUp9n", 900537 },
{ "DD1uDEQWMWXfavbnZjAbiRZNY4N3zCfsqJ", 900537 },
{ "D8UwYrzy2LcvLGJQ5WhEosFV27d3EAfCn3", 900537 },
{ "DE7xCPEGNFxG4tsmrffZo8mjUcJFv5rqJc", 900537 },
{ "D6v3xH7duBdMns5wPmqxkQdSygLCDVGxGW", 900537 },
{ "D8jsEtrCaYZm5RY12FXtCpBKTLJUfAzZRb", 900537 },
{ "DQMHcE3BSXYB6j484ks1uYNP3ZAAJmyzUs", 900537 },
{ "DSZCYoq9VijYwBbRtvNuHdjj9vKGG8WJyx", 900537 },
{ "DTepEVAUBoDPDiJRz8xuFk2we6SdBpsAXB", 900537 },
{ "DGsAikWijivMPLYrWNxpjpDoYVsNXovdu5", 900537 },
{ "DHdAgQSfUEMHMmzkCXkVV7PkZcicGKZr84", 900537 },
{ "DGHReU3Jj9tcYV2VvxtDpJk2odGtiaaCBt", 900537 },
{ "DJmVY6kg6SH7LB4gudPjKhcjtZYENDygtq", 900537 },
{ "DNkDebTUcieJ4TaXQFhzaQ5PTqdeixTbwg", 900537 },
{ "DDAUZUz1DWuEYEi7GN3BgsTvUqv7TW5yap", 900537 },
{ "D9rxeSd8fvGdgRdiSBCCSyKXP1nprnjuxK", 900537 },
{ "DGgo2BeNbdbtvHhpD96oxya1MmELreP7M2", 900537 },
{ "DKywMxFgmmEdTkKcoZNsV1FvULgjdLhzw8", 900537 },
{ "DNR2ehG2CHHZVwRpnr7D59r64bfptckFpN", 900537 },
{ "DFUpqpsVFsdB4RQ3tcgQryB22GpiQV9CHQ", 900537 },
{ "DDbrPCnzwLF6CiNW4uErqZAAHoXB9yio4B", 900537 },
{ "DDYJ5SunjJH88a6XaxJoVtrWZGRfz7AMHF", 900537 },
{ "D8EWD4dhQAupRU7wbo7zpqp2mYrFKnC5NA", 900537 },
{ "D5C18FLjL8m6nrrZ52JMvnLaf2McsqnMQg", 900537 },
{ "DFK47Bij4pCRExAQC6La9uos8W4CcZmXwC", 900537 },
{ "DTNcPqByDBzSYhfbwfwr2hCqNg9tj6wji4", 900537 },
{ "DTjK5an9tXHoXgfDmthfD6uVdoy8LkJsYm", 900537 },
{ "DSU6bf6PPp9dJ7szfZHgckoncPi8VWV2g4", 900537 },
{ "DTLfCEicRrxbmFN2362XtWJk5wTEi551Y5", 900537 },
{ "DSEdtVYEZw7WRmLff8ZPXmQEsbQbjHBRuE", 900537 },
{ "D5S6BH73TNJ4mitAc1qsgcKyLXYaobLe7Y", 900537 },
{ "DENGPYFTr9mrWfDhB8yqqYTdrRVJrxGGou", 900537 },
{ "DAkxhqgt1ATAVjs43VUdNkbyadXCWA841i", 900537 },
{ "DM9dHLbGs5ZDUTrDePD6oVqZrNLYJwFrxq", 900537 },
{ "DQgBvBpzKdhXkiArpsRWbr1EsSmhDsfXYy", 900537 },
{ "DDyLXUkD4jKrZDFvxkVhgksPdfK9VqyktZ", 900537 },
{ "DDyw67fBnVB17GW3GF3Q6PvxuSSh7WMBDE", 900537 },
{ "DCj8PJChZ5ZE3HyeonGnXGtV8GsqoV7j8i", 900537 },
{ "D96NkYkVhREyahWqZ8j8eVDrMTw8Aw48AE", 900537 },
{ "DSW2Vhzn8vA8WZngVZUb2FsJV2g4PnzF6Z", 900537 },
{ "DJoCjfPBmyH9tgsvYejL9GFEZf4ohKZiQT", 900537 },
};

// height-based activations
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,11 @@ DisconnectResult DisconnectBlock(CBlock& block, CBlockIndex* pindex, CCoinsViewC
// track money
nMoneySupply -= (nValueOut - nValueIn);

// clean last paid v2
if (masternodePayments.mapMasternodeBlocks.count(pindex->nHeight)) {
masternodePayments.mapMasternodeBlocks[pindex->nHeight].paidPayee = CScript();
}

// move best block pointer to prevout block
view.SetBestBlock(pindex->pprev->GetBlockHash());

Expand Down
69 changes: 67 additions & 2 deletions src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,20 @@ void CMasternodePayments::ProcessMessageMasternodePayments(CNode* pfrom, std::st
return;
}

if (winner.nBlockHeight >= nHeight &&
sporkManager.IsSporkActive(SPORK_109_FORCE_ENABLED_VOTED_MASTERNODE)
) {
CMasternode* pmn = mnodeman.Find(winner.payee);
if (!pmn) {
LogPrint(BCLog::MASTERNODE, "mnw - winner payee is not a masternode");
return;
}
if (!pmn->IsEnabled()) {
LogPrint(BCLog::MASTERNODE, "mnw - winner payee is a masternode but is not ENABLED");
return;
}
}

CTxDestination address1;
ExtractDestination(winner.payee, address1);

Expand Down Expand Up @@ -551,6 +565,28 @@ bool CMasternodePayments::AddWinningMasternode(CMasternodePaymentWinner& winnerI
return true;
}

bool CMasternodeBlockPayees::HasPaidPayee(const CScript& payee) {

if(paidPayee.empty() && nBlockHeight <= chainActive.Height()) {
CBlockIndex* pblockindex = chainActive[nBlockHeight];
CBlock block;

if (ReadBlockFromDisk(block, pblockindex)) {
CTransaction tx = block.vtx[block.IsProofOfWork() ? 0 : 1];

for (CTxOut out : tx.vout) {
if (out.nValue == CMasternode::GetMasternodePayment(nBlockHeight) &&
out.scriptPubKey == payee
) {
paidPayee = out.scriptPubKey;
}
}
}
}

return !paidPayee.empty() && paidPayee == payee;
}

bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew, int nBlockHeight)
{
LOCK(cs_vecPayments);
Expand Down Expand Up @@ -580,7 +616,35 @@ bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew, int n
}

if (payee.nVotes >= MNPAYMENTS_SIGNATURES_REQUIRED) {
if (found) return true;
if (found) {
bool ret = false;
if(sporkManager.IsSporkActive(SPORK_110_FORCE_ENABLED_MASTERNODE_PAYMENT)) {
CMasternode* pmn = mnodeman.Find(payee.scriptPubKey);
ret = pmn && pmn->IsEnabled(); // it is a existing masternode and it is enabled then it is OK

if(ret && sporkManager.IsSporkActive(SPORK_111_FORCE_ELIGIBLE_MASTERNODE_PAYMENT)) {
ret = false;
int nCount = 0;
std::vector<std::pair<int64_t, CTxIn>> vecMasternodeLastPaid;
mnodeman.GetNextMasternodeInQueueForPayment(nBlockHeight, true, nCount, vecMasternodeLastPaid);

for (PAIRTYPE(int64_t, CTxIn) & s : vecMasternodeLastPaid) {
pmn = mnodeman.Find(s.second);
if (!pmn) continue;

if (GetScriptForDestination(pmn->pubKeyCollateralAddress.GetID()) == payee.scriptPubKey) {
ret = true;
}
}
}
} else {
ret = true;
}
if (ret && masternodePayments.mapMasternodeBlocks.count(nBlockHeight)) {
masternodePayments.mapMasternodeBlocks[nBlockHeight].paidPayee = payee.scriptPubKey;
}
return ret;
}

CTxDestination address1;
ExtractDestination(payee.scriptPubKey, address1);
Expand Down Expand Up @@ -697,7 +761,8 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)

// pay to the oldest MN that still had no payment but its input is old enough and it was active long enough
int nCount = 0;
CMasternode* pmn = mnodeman.GetNextMasternodeInQueueForPayment(nBlockHeight, true, nCount);
std::vector<std::pair<int64_t, CTxIn>> vecMasternodeLastPaid;
CMasternode* pmn = mnodeman.GetNextMasternodeInQueueForPayment(nBlockHeight, true, nCount, vecMasternodeLastPaid);

if (pmn != NULL) {
LogPrint(BCLog::MASTERNODE,"CMasternodePayments::ProcessBlock() Found by FindOldestNotInVec \n");
Expand Down
2 changes: 2 additions & 0 deletions src/masternode-payments.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class CMasternodeBlockPayees
public:
int nBlockHeight;
std::vector<CMasternodePayee> vecPayments;
CScript paidPayee;

CMasternodeBlockPayees()
{
Expand Down Expand Up @@ -144,6 +145,7 @@ class CMasternodeBlockPayees
return false;
}

bool HasPaidPayee(const CScript& payee);
bool IsTransactionValid(const CTransaction& txNew, int nBlockHeight);
std::string GetRequiredPaymentsString();

Expand Down
9 changes: 7 additions & 2 deletions src/masternode-sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ bool CMasternodeSync::IsBlockchainSynced()
blockTime = pindex->nTime;
}

if (blockTime + 60 * 60 < lastProcess)
return false;
if(sporkManager.GetSporkValue(SPORK_104_MAX_BLOCK_TIME) > lastProcess) {
if (blockTime + 60 * 60 < lastProcess)
return false;
}

fBlockchainSynced = true;

Expand Down Expand Up @@ -181,6 +183,9 @@ void CMasternodeSync::GetNextAsset()
}
RequestedMasternodeAttempt = 0;
nAssetSyncStarted = GetTime();

// Notify the UI
uiInterface.NotifyBlockTip(IsInitialBlockDownload(), chainActive.Tip());
}

std::string CMasternodeSync::GetSyncStatus()
Expand Down
Loading

0 comments on commit 54d5ead

Please sign in to comment.