// signHeader properly signs the header with all keys from first to last exclusive.
signHeader properly signs the header with all keys from first to last exclusive.
// signHeader properly signs the header with all keys from first to last exclusive .
func (pkz privKeys) signHeader(header *types.Header, first, last int) *types.Commit {
	commitSigs := make([]*types.CommitSig, len(pkz))
	vset := pkz.ToValidators(1, 0)
	for i := first; i < last && i < len(pkz); i++ {
		vote := makeVote(header, vset, pkz[i])
		commitSigs[vote.ValidatorIndex] = vote.CommitSig()
	}
	blockID := types.BlockID{Hash: header.Hash()}
	return types.NewCommit(blockID, commitSigs)
}
func ( pkz privKeys ) signHeader ( header * types . Header , first , last int ) * types . Commit { commitSigs := make ( [ ] * types . CommitSig , len ( pkz ) ) vset := pkz . ToValidators ( 1 , 0 ) for i := first ; i < last && i < len ( pkz ) ; i ++ { vote := makeVote ( header , vset , pkz [ i ] ) commitSigs [ vote . ValidatorIndex ] = vote . CommitSig ( ) } blockID := types . BlockID { Hash : header . Hash ( ) } return types . NewCommit ( blockID , commitSigs ) }
signHeader properly signs the header with all keys from first to last exclusive.
signHeader properly signs the header with all keys from first to last exclusive .
// We need this list to keep the ordering. // Fill in the votes we want.