Skip to content

Commit

Permalink
all: minor cleanups spotted by unparam
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan authored and p4u committed Oct 10, 2023
1 parent 3961de4 commit 95100dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions subpub/subpub.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,14 @@ func (s *SubPub) listen(receiver chan<- *Message) {
}

// Close terminates the subpub networking stack
func (s *SubPub) Close() error {
func (s *SubPub) Close() {
log.Debug("received close signal")
select {
case <-s.close:
// already closed
return nil
default:
close(s.close)
close(s.messages)
return nil
}
}

Expand Down
5 changes: 1 addition & 4 deletions vochain/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,11 @@ func NewBaseApplication(dbType, dbpath string) (*BaseApplication, error) {
istc := ist.NewISTC(state)

// Create the transaction handler for checking and processing transactions
transactionHandler, err := transaction.NewTransactionHandler(
transactionHandler := transaction.NewTransactionHandler(
state,
istc,
filepath.Join(dbpath, "txHandler"),
)
if err != nil {
return nil, fmt.Errorf("cannot create transaction handler: (%v)", err)
}
// Load or download the zk verification keys
if err := transactionHandler.LoadZkCircuit(circuit.DefaultCircuitConfigurationTag); err != nil {
return nil, fmt.Errorf("cannot load zk circuit: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions vochain/transaction/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ type TransactionHandler struct {
}

// NewTransactionHandler creates a new TransactionHandler.
func NewTransactionHandler(state *vstate.State, istc *ist.Controller, dataDir string) (*TransactionHandler, error) {
func NewTransactionHandler(state *vstate.State, istc *ist.Controller, dataDir string) *TransactionHandler {
return &TransactionHandler{
state: state,
dataDir: dataDir,
istc: istc,
}, nil
}
}

func (t *TransactionHandler) LoadZkCircuit(configTag string) error {
Expand Down

0 comments on commit 95100dc

Please sign in to comment.