Skip to content

Commit

Permalink
Check unique-properties of ProUpRegTx when building new list
Browse files Browse the repository at this point in the history
  • Loading branch information
levonpetrosyan93 committed Apr 6, 2021
1 parent 580f842 commit b2bfb13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,11 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C
if (!dmn) {
return _state.DoS(100, false, REJECT_INVALID, "bad-protx-hash");
}

if (newList.HasUniqueProperty(proTx.pubKeyOperator) && newList.GetUniquePropertyMN(proTx.pubKeyOperator)->proTxHash != proTx.proTxHash) {
return _state.DoS(100, false, REJECT_DUPLICATE, "bad-protx-dup-key");
}

auto newState = std::make_shared<CDeterministicMNState>(*dmn->pdmnState);
if (newState->pubKeyOperator.Get() != proTx.pubKeyOperator) {
// reset all operator related fields and put MN into PoSe-banned state in case the operator key changes
Expand Down

0 comments on commit b2bfb13

Please sign in to comment.