fundingmanager: add maxHtlcs to openChanReq

This commit is contained in:
Conner Fromknecht 2020-08-12 15:45:39 -07:00
parent 8a22e4fd1c
commit ef69537c7f
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7
2 changed files with 7 additions and 1 deletions

@ -3110,6 +3110,7 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) {
minHtlcIn = msg.minHtlcIn
remoteCsvDelay = msg.remoteCsvDelay
maxValue = msg.maxValueInFlight
maxHtlcs = msg.maxHtlcs
)
// We'll determine our dust limit depending on which chain is active.
@ -3248,6 +3249,10 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) {
maxValue = f.cfg.RequiredRemoteMaxValue(capacity)
}
if maxHtlcs == 0 {
maxHtlcs = f.cfg.RequiredRemoteMaxHTLCs(capacity)
}
// If a pending channel map for this peer isn't already created, then
// we create one, ultimately allowing us to track this pending
// reservation within the target peer.
@ -3281,7 +3286,6 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) {
// policy to determine of required commitment constraints for the
// remote party.
chanReserve := f.cfg.RequiredRemoteChanReserve(capacity, ourDustLimit)
maxHtlcs := f.cfg.RequiredRemoteMaxHTLCs(capacity)
fndgLog.Infof("Starting funding workflow with %v for pending_id(%x), "+
"committype=%v", msg.peer.Address(), chanID, commitType)

@ -3343,6 +3343,8 @@ type openChanReq struct {
// be pending within the channel. It only applies to the remote party.
maxValueInFlight lnwire.MilliSatoshi
maxHtlcs uint16
// TODO(roasbeef): add ability to specify channel constraints as well
// chanFunder is an optional channel funder that allows the caller to