mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
liquidity: add initiator to swap requests
This commit is contained in:
parent
8758d00862
commit
481839b0fb
3 changed files with 9 additions and 0 deletions
|
|
@ -146,6 +146,7 @@ func TestAutoLoopEnabled(t *testing.T) {
|
|||
SweepConfTarget: params.SweepConfTarget,
|
||||
OutgoingChanSet: loopdb.ChannelSet{chanID1.ToUint64()},
|
||||
Label: labels.AutoOutLabel(),
|
||||
Initiator: autoloopSwapInitiator,
|
||||
}
|
||||
|
||||
chan2Swap = &loop.OutRequest{
|
||||
|
|
@ -161,6 +162,7 @@ func TestAutoLoopEnabled(t *testing.T) {
|
|||
SweepConfTarget: params.SweepConfTarget,
|
||||
OutgoingChanSet: loopdb.ChannelSet{chanID2.ToUint64()},
|
||||
Label: labels.AutoOutLabel(),
|
||||
Initiator: autoloopSwapInitiator,
|
||||
}
|
||||
|
||||
loopOuts = []loopOutRequestResp{
|
||||
|
|
|
|||
|
|
@ -99,6 +99,10 @@ const (
|
|||
// DefaultAutoOutTicker is the default amount of time between automated
|
||||
// loop out checks.
|
||||
DefaultAutoOutTicker = time.Minute * 10
|
||||
|
||||
// autoloopSwapInitiator is the value we send in the initiator field of
|
||||
// a swap request when issuing an automatic swap.
|
||||
autoloopSwapInitiator = "autoloop"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -704,6 +708,7 @@ func (m *Manager) makeLoopOutRequest(ctx context.Context,
|
|||
MaxSwapFee: quote.SwapFee,
|
||||
MaxPrepayAmount: quote.PrepayAmount,
|
||||
SweepConfTarget: m.params.SweepConfTarget,
|
||||
Initiator: autoloopSwapInitiator,
|
||||
}
|
||||
|
||||
if autoOut {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ var (
|
|||
MaxSwapFee: testQuote.SwapFee,
|
||||
MaxPrepayAmount: testQuote.PrepayAmount,
|
||||
SweepConfTarget: loop.DefaultSweepConfTarget,
|
||||
Initiator: autoloopSwapInitiator,
|
||||
}
|
||||
|
||||
// chan2Rec is the suggested swap for channel 2 when we use chanRule.
|
||||
|
|
@ -80,6 +81,7 @@ var (
|
|||
MaxPrepayAmount: testQuote.PrepayAmount,
|
||||
MaxSwapFee: testQuote.SwapFee,
|
||||
SweepConfTarget: loop.DefaultSweepConfTarget,
|
||||
Initiator: autoloopSwapInitiator,
|
||||
}
|
||||
|
||||
// chan1Out is a contract that uses channel 1, used to represent on
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue