mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-19 13:17:51 +02:00
funding+order: move DefaultBatchStepTimeout
We need to use the DefaultBatchStepTimeout variable outside of the funding manager as well and move it to the order package to not create a circular dependency when accessing it from the root package.
This commit is contained in:
parent
fc09828d95
commit
4d6fdae004
3 changed files with 13 additions and 12 deletions
|
|
@ -26,17 +26,6 @@ import (
|
|||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultBatchStepTimeout is the default time we allow an action that
|
||||
// blocks the batch conversation (like peer connection establishment or
|
||||
// channel open) to take. If any action takes longer, we might reject
|
||||
// the order from that slow peer. This value SHOULD be lower than the
|
||||
// defaultMsgTimeout on the server side otherwise nodes might get kicked
|
||||
// out of the match making process for timing out even though it was
|
||||
// their peer's fault.
|
||||
DefaultBatchStepTimeout = 15 * time.Second
|
||||
)
|
||||
|
||||
// MatchRejectErr is an error type that is returned from the funding manager if
|
||||
// the trader rejects certain orders instead of the whole batch.
|
||||
type MatchRejectErr struct {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
|
|
@ -27,6 +28,17 @@ const (
|
|||
MaxBatchIDHistoryLookup = 10_000
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultBatchStepTimeout is the default time we allow an action that
|
||||
// blocks the batch conversation (like peer connection establishment or
|
||||
// channel open) to take. If any action takes longer, we might reject
|
||||
// the order from that slow peer. This value SHOULD be lower than the
|
||||
// defaultMsgTimeout on the server side otherwise nodes might get kicked
|
||||
// out of the match making process for timing out even though it was
|
||||
// their peer's fault.
|
||||
DefaultBatchStepTimeout = 15 * time.Second
|
||||
)
|
||||
|
||||
// BatchVersion is the type for the batch verification protocol.
|
||||
type BatchVersion uint32
|
||||
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ func (s *Server) setupClient() error {
|
|||
WalletKit: s.lndServices.WalletKit,
|
||||
LightningClient: s.lndServices.Client,
|
||||
BaseClient: s.lndClient,
|
||||
BatchStepTimeout: funding.DefaultBatchStepTimeout,
|
||||
BatchStepTimeout: order.DefaultBatchStepTimeout,
|
||||
NewNodesOnly: s.cfg.NewNodesOnly,
|
||||
PendingOpenChannels: make(
|
||||
chan *lnrpc.ChannelEventUpdate_PendingOpenChannel,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue