Browse Source

Explicitly ensure length > 0 to sign vote extension

Signed-off-by: Thane Thomson <connect@thanethomson.com>
thane/7655-vote-extensions
Thane Thomson 3 years ago
parent
commit
e0ca4549de
No known key found for this signature in database GPG Key ID: 19811391D676EE45
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      types/priv_validator.go

+ 1
- 1
types/priv_validator.go View File

@ -95,7 +95,7 @@ func (pv MockPV) SignVote(ctx context.Context, chainID string, vote *tmproto.Vot
return err return err
} }
vote.Signature = sig vote.Signature = sig
if vote.Extension != nil {
if len(vote.Extension) > 0 {
vote.ExtensionSignature, err = pv.PrivKey.Sign(vote.Extension) vote.ExtensionSignature, err = pv.PrivKey.Sign(vote.Extension)
if err != nil { if err != nil {
return err return err


Loading…
Cancel
Save