Skip to content

Commit dd784bb

Browse files
committed
[Cleanup] Deprecate SPORK 16 (zerocoin maintenance)
SPORK_16 value is still checked in: - AcceptToMemoryPool (but there's a static check at lines 418-421) - ConnectBlock (but there's a height-based check at lines 1562-1564, and an additional height-based check inside CheckBlock)
1 parent 179662c commit dd784bb

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

src/net_processing.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,6 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
12291229
// TODO: Move this to an instant broadcast of the sporks.
12301230
bool fMissingSporks = !pSporkDB->SporkExists(SPORK_14_NEW_PROTOCOL_ENFORCEMENT) ||
12311231
!pSporkDB->SporkExists(SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2) ||
1232-
!pSporkDB->SporkExists(SPORK_16_ZEROCOIN_MAINTENANCE_MODE) ||
12331232
!pSporkDB->SporkExists(SPORK_19_COLDSTAKING_MAINTENANCE) ||
12341233
!pSporkDB->SporkExists(SPORK_20_SAPLING_MAINTENANCE);
12351234

src/spork.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ std::vector<CSporkDef> sporkDefs = {
2323
MAKE_SPORK_DEF(SPORK_13_ENABLE_SUPERBLOCKS, 4070908800ULL), // OFF
2424
MAKE_SPORK_DEF(SPORK_14_NEW_PROTOCOL_ENFORCEMENT, 4070908800ULL), // OFF
2525
MAKE_SPORK_DEF(SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2, 4070908800ULL), // OFF
26-
MAKE_SPORK_DEF(SPORK_16_ZEROCOIN_MAINTENANCE_MODE, 4070908800ULL), // OFF
2726
MAKE_SPORK_DEF(SPORK_19_COLDSTAKING_MAINTENANCE, 4070908800ULL), // OFF
2827
MAKE_SPORK_DEF(SPORK_20_SAPLING_MAINTENANCE, 4070908800ULL), // OFF
2928
MAKE_SPORK_DEF(SPORK_21_LEGACY_MNS_MAX_HEIGHT, 4070908800ULL), // OFF

src/sporkid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ enum SporkId : int32_t {
2020
SPORK_13_ENABLE_SUPERBLOCKS = 10012,
2121
SPORK_14_NEW_PROTOCOL_ENFORCEMENT = 10013,
2222
SPORK_15_NEW_PROTOCOL_ENFORCEMENT_2 = 10014,
23-
SPORK_16_ZEROCOIN_MAINTENANCE_MODE = 10015,
23+
SPORK_16_ZEROCOIN_MAINTENANCE_MODE = 10015, // Deprecated in 5.2.99
2424
SPORK_17_COLDSTAKING_ENFORCEMENT = 10017, // Deprecated in 4.3.99
2525
SPORK_18_ZEROCOIN_PUBLICSPEND_V4 = 10018, // Deprecated in 5.2.99
2626
SPORK_19_COLDSTAKING_MAINTENANCE = 10019,

src/validation.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,6 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C
402402
*pfMissingInputs = false;
403403

404404
// Check maintenance mode
405-
bool hasTxZerocoins = tx.ContainsZerocoins();
406-
if (sporkManager.IsSporkActive(SPORK_16_ZEROCOIN_MAINTENANCE_MODE) && hasTxZerocoins)
407-
return state.DoS(10, error("%s : Zerocoin transactions are temporarily disabled for maintenance",
408-
__func__), REJECT_INVALID, "bad-tx-zerocoin-maintenance");
409405
if (sporkManager.IsSporkActive(SPORK_20_SAPLING_MAINTENANCE) && tx.IsShieldedTx())
410406
return state.DoS(10, error("%s : Shielded transactions are temporarily disabled for maintenance",
411407
__func__), REJECT_INVALID, "bad-tx-sapling-maintenance");
@@ -415,7 +411,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C
415411
int chainHeight = chainActive.Height();
416412

417413
// Zerocoin txes are not longer accepted in the mempool.
418-
if (hasTxZerocoins) {
414+
if (tx.ContainsZerocoins()) {
419415
return state.DoS(100, error("%s : v5 upgrade enforced, zerocoin disabled", __func__),
420416
REJECT_INVALID, "bad-tx-with-zc");
421417
}
@@ -1539,7 +1535,6 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
15391535
std::vector<PrecomputedTransactionData> precomTxData;
15401536
precomTxData.reserve(block.vtx.size()); // Required so that pointers to individual precomTxData don't get invalidated
15411537
bool fInitialBlockDownload = IsInitialBlockDownload();
1542-
bool fZerocoinMaintenance = (block.nTime > sporkManager.GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE));
15431538
bool fSaplingMaintenance = (block.nTime > sporkManager.GetSporkValue(SPORK_20_SAPLING_MAINTENANCE));
15441539
for (unsigned int i = 0; i < block.vtx.size(); i++) {
15451540
const CTransaction& tx = *block.vtx[i];
@@ -1550,11 +1545,8 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
15501545
return state.DoS(100, error("ConnectBlock() : too many sigops"), REJECT_INVALID, "bad-blk-sigops");
15511546

15521547
// Check maintenance mode
1553-
if (!fInitialBlockDownload) {
1554-
if (fZerocoinMaintenance && tx.ContainsZerocoins())
1555-
return state.DoS(100, error("%s : zerocoin transactions are currently in maintenance mode", __func__));
1556-
if (fSaplingMaintenance && tx.IsShieldedTx())
1557-
return state.DoS(100, error("%s : shielded transactions are currently in maintenance mode", __func__));
1548+
if (!fInitialBlockDownload && fSaplingMaintenance && tx.IsShieldedTx()) {
1549+
return state.DoS(100, error("%s : shielded transactions are currently in maintenance mode", __func__));
15581550
}
15591551

15601552
// If v5 is active, bye bye zerocoin

0 commit comments

Comments
 (0)