Skip to content

Commit

Permalink
[BUG] Check for duplicate operator key when processing ProUpReg txes
Browse files Browse the repository at this point in the history
Otherwise a block with two protx using the same key could be accepted
and then cause an assertion failure in AddUniqueProperty.
  • Loading branch information
random-zebra committed Jul 6, 2021
1 parent 553cd56 commit 864c0f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,9 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C
if (!dmn) {
return _state.DoS(100, false, REJECT_INVALID, "bad-protx-hash");
}
if (newList.HasUniqueProperty(pl.keyIDOperator) && newList.GetUniquePropertyMN(pl.keyIDOperator)->proTxHash != pl.proTxHash) {
return _state.DoS(100, false, REJECT_DUPLICATE, "bad-protx-dup-operator-key");
}
auto newState = std::make_shared<CDeterministicMNState>(*dmn->pdmnState);
if (newState->keyIDOperator != pl.keyIDOperator) {
// reset all operator related fields and put MN into PoSe-banned state in case the operator key changes
Expand Down

0 comments on commit 864c0f5

Please sign in to comment.