Skip to content

Commit e2081a7

Browse files
committed
[Consensus] Don't Allow ProUpReg txes while in transition to DMN
As changing the payout address, could be used maliciously to game the old payment system.
1 parent 336e18c commit e2081a7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/evo/providertx.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,12 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal
384384
}
385385

386386
if (pindexPrev) {
387+
// ProUpReg txes are disabled when the legacy system is still active
388+
// !TODO: remove after complete transition to DMN
389+
if (!deterministicMNManager->LegacyMNObsolete(pindexPrev->nHeight + 1)) {
390+
return state.DoS(10, false, REJECT_INVALID, "spork-21-inactive");
391+
}
392+
387393
auto mnList = deterministicMNManager->GetListForBlock(pindexPrev);
388394
auto dmn = mnList.GetMN(pl.proTxHash);
389395
if (!dmn) {

src/rpc/rpcevo.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,10 @@ UniValue protx_update_registrar(const JSONRPCRequest& request)
862862
}
863863
CheckEvoUpgradeEnforcement();
864864

865+
if (!deterministicMNManager->LegacyMNObsolete()) {
866+
throw JSONRPCError(RPC_MISC_ERROR, "Legacy masternode system still active. ProUpReg transactions are not accepted yet.");
867+
}
868+
865869
EnsureWalletIsUnlocked(pwallet);
866870
// Make sure the results are valid at least up to the most recent block
867871
// the user could have gotten from another RPC command prior to now

0 commit comments

Comments
 (0)