Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ install-loopd-loop:

compile-nodeguard-proto:
rm -rf nodeguard && protoc -I rpc --go_out=. --go-grpc_out=. rpc/*.proto && mockgen -destination ./nodeguard/nodeguard_mock.go -source nodeguard/nodeguard_grpc.pb.go -package nodeguard && mockgen -destination ./nodeguard/nodeguard_mock.go -source nodeguard/nodeguard_grpc.pb.go -package nodeguard
compile-lnd-client-mock:
mockgen -destination lightning_rpc_mock.go -source lnd/lnrpc/lightning_grpc.pb.go -package main
compile-provider-mock:
mockgen -destination ./provider/provider_mock.go -source provider/provider.go -package provider && mockgen -destination ./provider/loopd_mock.go -source loop/looprpc/client_grpc.pb.go -package provider
cover-test:
go test ./... -coverprofile=coverage.out; go tool cover -html=coverage.out
start-loopserver: build-loopserver
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.4-alpine AS builder
FROM golang:1.25-alpine AS builder
WORKDIR /src/
COPY . .
RUN go get -d -v ./...
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Flags:
--nodeguardHost string Hostname:port to connect to nodeguard
--pollingInterval string Interval to poll data (default "15s")
--retriesBeforeBackoff int Number of retries before applying backoff to the swap (default 3)
--swapLockTimeout string Timeout for swap locks to automatically expire (default "30m")
--swapPublicationOffset string Swap publication deadline offset (Maximum time for the swap provider to publish the swap) (default "60m")
--sweepConfTarget string Target number of confirmations for swaps, this uses bitcoin core broken estimator, procced with caution (default "400")
```
Expand Down Expand Up @@ -63,6 +64,7 @@ All the flags can be set as environment variables, with the following format, ex
- LOGLEVEL (optional) : Log level (default info) from: {trace, debug, info, warn, error, fatal, panic}
- LOGFORMAT (optional) : Log format (default json) from: {json, text}
- SWAPPUBLICATIONOFFSET (optional) : Swap publication deadline offset (Maximum time for the swap provider to publish the swap) (default 30m)
- SWAPLOCKTIMEOUT (optional) : Timeout for swap locks to automatically expire (default 30m)
- RETRIESBEFOREBACKOFF (optional) : Number of retries before applying backoff to the swap (default: 3)
- BACKOFFCOEFFICIENT (optional) : Coefficient to apply to the backoff (default: 0.95)
- BACKOFFLIMIT (optional) : Limit coefficient of the backoff (default: 0.1)
Expand Down
4 changes: 4 additions & 0 deletions flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ func init() {
rootCmd.Flags().String("sweepConfTarget", "400", "Target number of confirmations for swaps, this uses bitcoin core broken estimator, procced with caution")
viper.BindPFlag("sweepConfTarget", rootCmd.Flags().Lookup("sweepConfTarget"))

// Swap lock timeout
rootCmd.Flags().String("swapLockTimeout", "30m", "Timeout for swap locks to automatically expire (e.g. 30m, 1h, 45m)")
viper.BindPFlag("swapLockTimeout", rootCmd.Flags().Lookup("swapLockTimeout"))

//Now we set the global vars

pollingInterval = viper.GetDuration("pollingInterval")
Expand Down
3 changes: 2 additions & 1 deletion liquidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,9 @@ func performSwap(info ManageChannelLiquidityInfo, channel *lnrpc.Channel, swapAm
WalletId: rule.SwapWalletId,
Address: resp.InvoiceBTCAddress,
Amount: swapAmount,
Destinations: []*nodeguard.Destination{{Address: resp.InvoiceBTCAddress, AmountSats: swapAmount}},
Description: fmt.Sprintf("Swap %v", resp.SwapId),
MempoolFeeRate: nodeguard.FEES_TYPE_ECONOMY_FEE,
MempoolFeeRate: nodeguard.FEES_TYPE_FASTEST_FEE,
}

withdrawalResponse, err := info.nodeguardClient.RequestWithdrawal(info.ctx, &withdrawalRequest)
Expand Down
Loading