Skip to content

Commit

Permalink
Merge pull request #35 from erbieio/feat_newproject2
Browse files Browse the repository at this point in the history
fix: not reward to cancel validators
  • Loading branch information
erbielab committed May 31, 2024
2 parents 95ec8d8 + 17b4100 commit c268f5e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions consensus/istanbul/ibft/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,15 @@ func (e *Engine) Prepare(chain consensus.ChainHeaderReader, header *types.Header
}
}

//The current block issues a reward for the previous block,
//but if the participant in the previous block consensus sends a validator to cancel the transaction
//and package it in the previous block, the current block does not send him a reward
for index, a := range validatorAddr {
if !validatorList.Exist(a) {
validatorAddr = append(validatorAddr[:index], validatorAddr[index+1:]...)
}
}

//If the reward address is on a proxy account, it will be restored to a pledge account
for index, a := range validatorAddr {
if v, ok := mp[a.String()]; ok {
Expand Down

0 comments on commit c268f5e

Please sign in to comment.