Skip to content

Commit 398c936

Browse files
authored
Merge pull request #580 from bnb-chain/develop
fix: not set agentToOperator while newAgent is zero address (#579)
2 parents 04bc57c + f11346c commit 398c936

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

contracts/BC_fusion/StakeHub.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,10 @@ contract StakeHub is System, Initializable, Protectable {
341341
}
342342

343343
_validators[operatorAddress].agent = newAgent;
344-
agentToOperator[newAgent] = operatorAddress;
344+
345+
if (newAgent != address(0)) {
346+
agentToOperator[newAgent] = operatorAddress;
347+
}
345348

346349
emit AgentChanged(operatorAddress, oldAgent, newAgent);
347350
}

0 commit comments

Comments
 (0)