From b5544a4560accea5af2b578227130b63eadb2645 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 17 Dec 2018 22:46:14 -0500 Subject: [PATCH] privval: remove mtx --- privval/priv_validator.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/privval/priv_validator.go b/privval/priv_validator.go index 016a264ef..6d1f80f21 100644 --- a/privval/priv_validator.go +++ b/privval/priv_validator.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "io/ioutil" - "sync" "time" "github.com/tendermint/tendermint/crypto" @@ -63,7 +62,6 @@ type FilePVLastSignState struct { SignBytes cmn.HexBytes `json:"signbytes,omitempty"` filePath string - mtx sync.Mutex } // GetAddress returns the address of the validator. @@ -150,9 +148,6 @@ func LoadOrGenFilePV(keyFilePath string, stateFilePath string) *FilePV { // Save persists the FilePV to disk. func (pv *FilePV) Save() { pv.saveKey() - - pv.LastSignState.mtx.Lock() - defer pv.LastSignState.mtx.Unlock() pv.saveState() } @@ -203,8 +198,6 @@ func (pv *FilePV) Reset() { // SignVote signs a canonical representation of the vote, along with the // chainID. Implements PrivValidator. func (pv *FilePV) SignVote(chainID string, vote *types.Vote) error { - pv.LastSignState.mtx.Lock() - defer pv.LastSignState.mtx.Unlock() if err := pv.signVote(chainID, vote); err != nil { return fmt.Errorf("Error signing vote: %v", err) } @@ -214,8 +207,6 @@ func (pv *FilePV) SignVote(chainID string, vote *types.Vote) error { // SignProposal signs a canonical representation of the proposal, along with // the chainID. Implements PrivValidator. func (pv *FilePV) SignProposal(chainID string, proposal *types.Proposal) error { - pv.LastSignState.mtx.Lock() - defer pv.LastSignState.mtx.Unlock() if err := pv.signProposal(chainID, proposal); err != nil { return fmt.Errorf("Error signing proposal: %v", err) }