Skip to content

Commit

Permalink
Remove a few sporks which are not used anymore (#2607)
Browse files Browse the repository at this point in the history
* Remove SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT

And always enforce payments.

* Remove SPORK_10_MASTERNODE_PAY_UPDATED_NODES and SPORK_10_MASTERNODE_PAY_UPDATED_NODES
  • Loading branch information
codablock authored and UdjinM6 committed Jan 3, 2019
1 parent d1910ea commit 7d58d87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
10 changes: 4 additions & 6 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,10 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Dash Core is downloading blocks...");
}

// when enforcement is on we need information about a masternode payee or otherwise our block is going to be orphaned by the network
// Get expected MN/superblock payees. The call to GetBlockTxOuts might fail on regtest/devnet or when
// testnet is reset. This is fine and we ignore failure (blocks will be accepted)
std::vector<CTxOut> voutMasternodePayments;
if (sporkManager.IsSporkActive(SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT)
&& !masternodeSync.IsBlockchainSynced()
&& !mnpayments.GetBlockTxOuts(chainActive.Height() + 1, 0, voutMasternodePayments))
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Dash Core is downloading masternode winners...");
mnpayments.GetBlockTxOuts(chainActive.Height() + 1, 0, voutMasternodePayments);

// next bock is a superblock and we need governance info to correctly construct it
if (sporkManager.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED)
Expand Down Expand Up @@ -722,7 +720,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request)

result.push_back(Pair("masternode", masternodeObj));
result.push_back(Pair("masternode_payments_started", pindexPrev->nHeight + 1 > consensusParams.nMasternodePaymentsStartBlock));
result.push_back(Pair("masternode_payments_enforced", deterministicMNManager->IsDIP3Active() || sporkManager.IsSporkActive(SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT)));
result.push_back(Pair("masternode_payments_enforced", true));

UniValue superblockObjArray(UniValue::VARR);
if(pblocktemplate->voutSuperblockPayments.size()) {
Expand Down
9 changes: 0 additions & 9 deletions src/spork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ std::map<int, int64_t> mapSporkDefaults = {
{SPORK_3_INSTANTSEND_BLOCK_FILTERING, 0}, // ON
{SPORK_5_INSTANTSEND_MAX_VALUE, 1000}, // 1000 Dash
{SPORK_6_NEW_SIGS, 4070908800ULL}, // OFF
{SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT, 4070908800ULL}, // OFF
{SPORK_9_SUPERBLOCKS_ENABLED, 4070908800ULL}, // OFF
{SPORK_10_MASTERNODE_PAY_UPDATED_NODES, 4070908800ULL}, // OFF
{SPORK_12_RECONSIDER_BLOCKS, 0}, // 0 BLOCKS
{SPORK_14_REQUIRE_SENTINEL_FLAG, 4070908800ULL}, // OFF
{SPORK_16_INSTANTSEND_AUTOLOCKS, 4070908800ULL}, // OFF
{SPORK_17_QUORUM_DKG_ENABLED, 4070908800ULL}, // OFF
};
Expand Down Expand Up @@ -284,11 +281,8 @@ int CSporkManager::GetSporkIDByName(const std::string& strName)
if (strName == "SPORK_3_INSTANTSEND_BLOCK_FILTERING") return SPORK_3_INSTANTSEND_BLOCK_FILTERING;
if (strName == "SPORK_5_INSTANTSEND_MAX_VALUE") return SPORK_5_INSTANTSEND_MAX_VALUE;
if (strName == "SPORK_6_NEW_SIGS") return SPORK_6_NEW_SIGS;
if (strName == "SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT") return SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT;
if (strName == "SPORK_9_SUPERBLOCKS_ENABLED") return SPORK_9_SUPERBLOCKS_ENABLED;
if (strName == "SPORK_10_MASTERNODE_PAY_UPDATED_NODES") return SPORK_10_MASTERNODE_PAY_UPDATED_NODES;
if (strName == "SPORK_12_RECONSIDER_BLOCKS") return SPORK_12_RECONSIDER_BLOCKS;
if (strName == "SPORK_14_REQUIRE_SENTINEL_FLAG") return SPORK_14_REQUIRE_SENTINEL_FLAG;
if (strName == "SPORK_16_INSTANTSEND_AUTOLOCKS") return SPORK_16_INSTANTSEND_AUTOLOCKS;
if (strName == "SPORK_17_QUORUM_DKG_ENABLED") return SPORK_17_QUORUM_DKG_ENABLED;

Expand All @@ -303,11 +297,8 @@ std::string CSporkManager::GetSporkNameByID(int nSporkID)
case SPORK_3_INSTANTSEND_BLOCK_FILTERING: return "SPORK_3_INSTANTSEND_BLOCK_FILTERING";
case SPORK_5_INSTANTSEND_MAX_VALUE: return "SPORK_5_INSTANTSEND_MAX_VALUE";
case SPORK_6_NEW_SIGS: return "SPORK_6_NEW_SIGS";
case SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT: return "SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT";
case SPORK_9_SUPERBLOCKS_ENABLED: return "SPORK_9_SUPERBLOCKS_ENABLED";
case SPORK_10_MASTERNODE_PAY_UPDATED_NODES: return "SPORK_10_MASTERNODE_PAY_UPDATED_NODES";
case SPORK_12_RECONSIDER_BLOCKS: return "SPORK_12_RECONSIDER_BLOCKS";
case SPORK_14_REQUIRE_SENTINEL_FLAG: return "SPORK_14_REQUIRE_SENTINEL_FLAG";
case SPORK_16_INSTANTSEND_AUTOLOCKS: return "SPORK_16_INSTANTSEND_AUTOLOCKS";
case SPORK_17_QUORUM_DKG_ENABLED: return "SPORK_17_QUORUM_DKG_ENABLED";
default:
Expand Down
3 changes: 0 additions & 3 deletions src/spork.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ static const int SPORK_2_INSTANTSEND_ENABLED = 10001;
static const int SPORK_3_INSTANTSEND_BLOCK_FILTERING = 10002;
static const int SPORK_5_INSTANTSEND_MAX_VALUE = 10004;
static const int SPORK_6_NEW_SIGS = 10005;
static const int SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT = 10007;
static const int SPORK_9_SUPERBLOCKS_ENABLED = 10008;
static const int SPORK_10_MASTERNODE_PAY_UPDATED_NODES = 10009;
static const int SPORK_12_RECONSIDER_BLOCKS = 10011;
static const int SPORK_14_REQUIRE_SENTINEL_FLAG = 10013;
static const int SPORK_16_INSTANTSEND_AUTOLOCKS = 10015;
static const int SPORK_17_QUORUM_DKG_ENABLED = 10016;

Expand Down

0 comments on commit 7d58d87

Please sign in to comment.