mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
staticaddr: configurable max htlc tx fee
In this commit we introduce maximum fee percentages for the static loop-in htlc transactions. Since the server has the ability to publish htlc transactions without settling the swap payment we have to restrict the amount the server allocates for fees of these transactions.
This commit is contained in:
parent
4d8c258671
commit
f3ec81fb68
3 changed files with 55 additions and 30 deletions
16
client.go
16
client.go
|
|
@ -141,6 +141,22 @@ type ClientConfig struct {
|
|||
// MaxPaymentRetries is the maximum times we retry an off-chain payment
|
||||
// (used in loop out).
|
||||
MaxPaymentRetries int
|
||||
|
||||
// MaxStaticAddrHtlcFeePercentage is the percentage of the swap amount
|
||||
// that we allow the server to charge for the htlc transaction.
|
||||
// Although highly unlikely, this is a defense against the server
|
||||
// publishing the htlc without paying the swap invoice, forcing us to
|
||||
// sweep the timeout path.
|
||||
MaxStaticAddrHtlcFeePercentage float64
|
||||
|
||||
// MaxStaticAddrHtlcBackupFeePercentage is the percentage of the swap
|
||||
// amount that we allow the server to charge for the htlc backup
|
||||
// transactions. This is a defense against the server publishing the
|
||||
// htlc backup without paying the swap invoice, forcing us to sweep the
|
||||
// timeout path. This value is elevated compared to
|
||||
// MaxStaticAddrHtlcFeePercentage since it serves the server as backup
|
||||
// transaction in case of fee spikes.
|
||||
MaxStaticAddrHtlcBackupFeePercentage float64
|
||||
}
|
||||
|
||||
// NewClient returns a new instance to initiate swaps with.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue