Browse Source

state: return to-be-used function

pull/703/head
Zach Ramsay 7 years ago
committed by Ethan Buchman
parent
commit
b3c5933a23
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      state/execution.go

+ 12
- 0
state/execution.go View File

@ -158,6 +158,18 @@ func updateValidators(validators *types.ValidatorSet, changedValidators []*abci.
return nil
}
// return a bit array of validators that signed the last commit
// NOTE: assumes commits have already been authenticated
func commitBitArrayFromBlock(block *types.Block) *cmn.BitArray {
signed := cmn.NewBitArray(len(block.LastCommit.Precommits))
for i, precommit := range block.LastCommit.Precommits {
if precommit != nil {
signed.SetIndex(i, true) // val_.LastCommitHeight = block.Height - 1
}
}
return signed
}
//-----------------------------------------------------
// Validate block


Loading…
Cancel
Save