multi: update linter, fix issues

This commit is contained in:
Oliver Gugger 2023-09-28 13:16:01 +02:00
parent bac1416636
commit 08026dab93
No known key found for this signature in database
GPG key ID: 8E4256593F177720
25 changed files with 525 additions and 346 deletions

View file

@ -10,6 +10,7 @@ import (
"strings"
"sync"
"sync/atomic"
"time"
"github.com/coreos/bbolt"
proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
@ -302,7 +303,10 @@ func (d *Daemon) startWebServers() error {
if d.restListener != nil {
log.Infof("Starting REST proxy listener")
d.restServer = &http.Server{Handler: restHandler}
d.restServer = &http.Server{
Handler: restHandler,
ReadHeaderTimeout: 5 * time.Second,
}
d.wg.Add(1)
go func() {

View file

@ -61,7 +61,7 @@ func migrateBoltdb(ctx context.Context, cfg *Config) error {
return err
}
// If the migration was successfull we'll rename the bolt db to
// If the migration was successful we'll rename the bolt db to
// loop.db.bk.
err = os.Rename(
filepath.Join(cfg.DataDir, "loop.db"),

View file

@ -49,6 +49,8 @@ func viewOut(swapClient *loop.Client, chainParams *chaincfg.Params) error {
}
for _, s := range swaps {
s := s
htlc, err := loop.GetHtlc(
s.Hash, &s.Contract.SwapContract, chainParams,
)
@ -98,6 +100,8 @@ func viewIn(swapClient *loop.Client, chainParams *chaincfg.Params) error {
}
for _, s := range swaps {
s := s
htlc, err := loop.GetHtlc(
s.Hash, &s.Contract.SwapContract, chainParams,
)