Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dpos/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1726,8 +1726,11 @@ func (s *State) processTransactions(txs []interfaces.Transaction, height uint32)
cancelDposV2AndDposV1V2Producer := func(key string, producer *Producer) {
oriState := producer.state
oriDepositAmount := producer.depositAmount
nodePublicKey := common.BytesToHexString(producer.info.NodePublicKey)
oriOwnerKey := s.NodeOwnerKeys[nodePublicKey]
s.History.Append(height, func() {
producer.state = Canceled
delete(s.NodeOwnerKeys, nodePublicKey)
producer.depositAmount -= state.MinDPoSV2DepositAmount
s.CanceledProducers[key] = producer
switch oriState {
Expand All @@ -1750,6 +1753,7 @@ func (s *State) processTransactions(txs []interfaces.Transaction, height uint32)
case Illegal:
s.IllegalProducers[key] = producer
}
s.NodeOwnerKeys[common.BytesToHexString(producer.info.NodePublicKey)] = oriOwnerKey
delete(s.CanceledProducers, key)
s.Nicknames[producer.info.NickName] = struct{}{}
})
Expand Down