lnwallet: extend Reservation with alias chan-type, feature-bit flags

This extends the Reservation arguments to include whether a pending
channel open has negotiated the zero-conf channel type, the scid-alias
channel type, and/or the scid-alias feature bit. The result of those
negotiates are stored in the OpenChannel's ChanType. The arguments to
NewChannelReservation have also been simplified.
This commit is contained in:
eugene
2022-04-04 16:15:02 -04:00
parent c9f5912601
commit 21c83b0744
3 changed files with 74 additions and 32 deletions

View File

@@ -153,6 +153,18 @@ type InitFundingReserveMsg struct {
// used.
ChanFunder chanfunding.Assembler
// ZeroConf is a boolean that is true if a zero-conf channel was
// negotiated.
ZeroConf bool
// OptionScidAlias is a boolean that is true if an option-scid-alias
// channel type was explicitly negotiated.
OptionScidAlias bool
// ScidAliasFeature is true if the option-scid-alias feature bit was
// negotiated.
ScidAliasFeature bool
// err is a channel in which all errors will be sent across. Will be
// nil if this initial set is successful.
//
@@ -845,10 +857,8 @@ func (l *LightningWallet) handleFundingReserveRequest(req *InitFundingReserveMsg
id := atomic.AddUint64(&l.nextFundingID, 1)
reservation, err := NewChannelReservation(
capacity, localFundingAmt, req.CommitFeePerKw, l, id,
req.PushMSat, l.Cfg.NetParams.GenesisHash, req.Flags,
req.CommitType, req.ChanFunder, req.PendingChanID,
thawHeight,
capacity, localFundingAmt, l, id, l.Cfg.NetParams.GenesisHash,
thawHeight, req,
)
if err != nil {
fundingIntent.Cancel()