Skip to content

Commit 3e5987e

Browse files
authored
fix: count nil vote as a signed block (#109)
1 parent 47c119f commit 3e5987e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/watcher/block.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func (w *BlockWatcher) computeValidatorStatus(block *types.Block) []ValidatorSta
253253
for i, sig := range block.LastCommit.Signatures {
254254
if val.Address == sig.ValidatorAddress.String() {
255255
bonded = true
256-
signed = (sig.BlockIDFlag == types.BlockIDFlagCommit)
256+
signed = (sig.BlockIDFlag != types.BlockIDFlagAbsent)
257257
rank = i + 1
258258
}
259259
if signed {

pkg/watcher/block_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func NewBlockInfo(block *types.Block, validatorStatus []ValidatorStatus) *BlockI
1919
// Compute total signed validators
2020
signedValidators := 0
2121
for _, sig := range block.LastCommit.Signatures {
22-
if sig.BlockIDFlag == types.BlockIDFlagCommit {
22+
if sig.BlockIDFlag != types.BlockIDFlagAbsent {
2323
signedValidators++
2424
}
2525
}

0 commit comments

Comments
 (0)