mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-08 04:50:16 +00:00
Only set vote extension signatures when signing is successful
Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -405,10 +405,11 @@ func (pv *FilePV) signVote(chainID string, vote *tmproto.Vote) error {
|
||||
vote.Signature = sig
|
||||
|
||||
// Sign the vote extension, regardless of whether it's present or not
|
||||
vote.ExtensionSignature, err = pv.Key.PrivKey.Sign(extSignBytes)
|
||||
extSig, err := pv.Key.PrivKey.Sign(extSignBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
vote.ExtensionSignature = extSig
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -96,8 +96,12 @@ func (pv MockPV) SignVote(ctx context.Context, chainID string, vote *tmproto.Vot
|
||||
return err
|
||||
}
|
||||
vote.Signature = sig
|
||||
vote.ExtensionSignature, err = pv.PrivKey.Sign(extSignBytes)
|
||||
return err
|
||||
extSig, err := pv.PrivKey.Sign(extSignBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
vote.ExtensionSignature = extSig
|
||||
return nil
|
||||
}
|
||||
|
||||
// Implements PrivValidator.
|
||||
|
||||
Reference in New Issue
Block a user