Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed May 4, 2024
1 parent 09d1735 commit e0ad406
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
"sync"

"filippo.io/age"

Expand All @@ -23,7 +22,6 @@ type ProposalHandler struct {
Identity age.Identity
blocklist map[string]struct{}
lastBlockList []byte
blockLock sync.RWMutex
}

func NewProposalHandler(txDecoder sdk.TxDecoder, identity age.Identity) *ProposalHandler {
Expand All @@ -35,12 +33,10 @@ func NewProposalHandler(txDecoder sdk.TxDecoder, identity age.Identity) *Proposa
}

func (h *ProposalHandler) SetBlockList(blob []byte) error {
h.blockLock.Lock()
defer h.blockLock.Unlock()

if h.Identity == nil {
return nil
}

if bytes.Equal(h.lastBlockList, blob) {
return nil
}
Expand Down Expand Up @@ -92,8 +88,6 @@ func (h *ProposalHandler) ValidateTransaction(txBz []byte) error {
return fmt.Errorf("tx of type %T does not implement SigVerifiableTx", tx)
}

h.blockLock.RLock()
defer h.blockLock.RUnlock()
for _, signer := range sigTx.GetSigners() {
if _, ok := h.blocklist[signer.String()]; ok {
return fmt.Errorf("signer is blocked: %s", signer.String())
Expand Down

0 comments on commit e0ad406

Please sign in to comment.