Skip to content

Commit

Permalink
build: fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bhandras committed Sep 26, 2024
1 parent a357474 commit 3a3c8ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
6 changes: 5 additions & 1 deletion frdrpcserver/rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"strings"
"sync"
"sync/atomic"
"time"

proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/lightninglabs/faraday/accounting"
Expand Down Expand Up @@ -298,7 +299,10 @@ func (s *RPCServer) Start() error {
if err != nil {
return err
}
s.restServer = &http.Server{Handler: restHandler}
s.restServer = &http.Server{
Handler: restHandler,
ReadHeaderTimeout: 3 * time.Second,
}

s.wg.Add(1)
go func() {
Expand Down
25 changes: 0 additions & 25 deletions itest/test_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,6 @@ func (c *testContext) mine() int {
return len(block.Transactions) - 1
}

// mine mines a block and verifies that the expected number of transactions is
// present (excluding the coinbase tx).
func (c *testContext) mineExactly(expectedTxCount int) {
c.t.Helper()

txCount := c.mine()
require.Equal(c.t, expectedTxCount, txCount)
}

// mempoolTxCount returns the number of txes currently in the mempool.
func (c *testContext) mempoolTxCount() int {
txes, err := c.bitcoindClient.GetRawMempool()
Expand Down Expand Up @@ -485,22 +476,6 @@ func (c *testContext) waitForMempoolTxCount(txCount int, msg string) {
)
}

// waitForTxesAndMine waits for a specified number of txes to arrive in the
// mempool and then mines a block.
func (c *testContext) waitForTxesAndMine(txCount int, msg string) {
c.t.Helper()

c.waitForMempoolTxCount(txCount, msg)
c.mineExactly(txCount)
}

// mempoolEmpty asserts that the mempool is empty.
func (c *testContext) mempoolEmpty() {
c.t.Helper()

require.Equal(c.t, 0, c.mempoolTxCount(), "mempool not empty")
}

// startFaraday starts faraday, connecting to our test context's alice lnd node.
// It returns process start errors and an error channel for errors that occur
// after the start.
Expand Down

0 comments on commit 3a3c8ca

Please sign in to comment.