From d4576f41935d9b9e493d664a0196b12288b46e70 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 20 Sep 2024 13:13:01 +0200 Subject: [PATCH] psbt_channel_funder+tapchannel: add remote max HTLC We want to be able to dictate how many HTLCs the remote side can add to the channel we create. We'll do the same for the responder side with a channel acceptor in one of the following commits. --- psbt_channel_funder.go | 1 + tapchannel/aux_funding_controller.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/psbt_channel_funder.go b/psbt_channel_funder.go index 42dde5888..dc9ab23fe 100644 --- a/psbt_channel_funder.go +++ b/psbt_channel_funder.go @@ -110,6 +110,7 @@ func (l *LndPbstChannelFunder) OpenChannel(ctx context.Context, }, }), lndclient.WithRemoteReserve(CustomChannelRemoteReserve), + lndclient.WithRemoteMaxHtlc(req.RemoteMaxHtlc), ) if err != nil { return nil, fmt.Errorf("unable to open channel with "+ diff --git a/tapchannel/aux_funding_controller.go b/tapchannel/aux_funding_controller.go index dbfc05e80..cf66e06c6 100644 --- a/tapchannel/aux_funding_controller.go +++ b/tapchannel/aux_funding_controller.go @@ -94,6 +94,11 @@ type OpenChanReq struct { // PushAmt is the amount of BTC to push to the remote peer. PushAmt btcutil.Amount + // RemoteMaxHtlc is the maximum number of HTLCs we allow the remote to + // add to the channel. If this is zero, then the default value defined + // by lnd (and dependent on the channel capacity) will be used. + RemoteMaxHtlc uint32 + // PeerPub is the identity public key of the remote peer we wish to // open the channel with. PeerPub btcec.PublicKey