Skip to content

Commit

Permalink
[TierTwo] Connect ProUpRev payload management in dmn manager
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra committed Jul 6, 2021
1 parent 9699143 commit a4a0afb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,28 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C

newList.UpdateMN(pl.proTxHash, newState);

if (debugLogs) {
LogPrintf("CDeterministicMNManager::%s -- MN %s updated at height %d: %s\n",
__func__, pl.proTxHash.ToString(), nHeight, pl.ToString());
}

} else if (tx.nType == CTransaction::TxType::PROUPREV) {
ProUpRevPL pl;
if (!GetTxPayload(tx, pl)) {
return _state.DoS(100, false, REJECT_INVALID, "bad-protx-payload");
}

CDeterministicMNCPtr dmn = newList.GetMN(pl.proTxHash);
if (!dmn) {
return _state.DoS(100, false, REJECT_INVALID, "bad-protx-hash");
}
auto newState = std::make_shared<CDeterministicMNState>(*dmn->pdmnState);
newState->ResetOperatorFields();
newState->BanIfNotBanned(nHeight);
newState->nRevocationReason = pl.nReason;

newList.UpdateMN(pl.proTxHash, newState);

if (debugLogs) {
LogPrintf("CDeterministicMNManager::%s -- MN %s updated at height %d: %s\n",
__func__, pl.proTxHash.ToString(), nHeight, pl.ToString());
Expand Down

0 comments on commit a4a0afb

Please sign in to comment.