Skip to content

Commit 48994fa

Browse files
committed
lnwallet: funding revamp checkpoint
Need local+remote aux leaves now. The calls DescFromPendingID shift now for bth remote+local party
1 parent 5870fa5 commit 48994fa

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

lnwallet/reservation.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,14 @@ type ChannelReservation struct {
218218

219219
fundingIntent chanfunding.Intent
220220

221-
// initAuxLeaves is an optional set of aux commitment leaves that'll
222-
// modify the way we construct the commitment transaction, in
221+
// localInitAuxLeaves is an optional set of aux commitment leaves
222+
// that'll modify the way we construct the commitment transaction, in
223223
// particular the tapscript leaves.
224-
initAuxLeaves fn.Option[CommitAuxLeaves]
224+
localInitAuxLeaves fn.Option[CommitAuxLeaves]
225+
226+
// remoteInitAuxLeaves is an optional set of aux commitment leaves for
227+
// the remote party.
228+
remoteInitAuxLeaves fn.Option[CommitAuxLeaves]
225229

226230
// nextRevocationKeyLoc stores the key locator information for this
227231
// channel.

lnwallet/wallet.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,13 @@ type AuxFundingDesc struct {
108108
// first commitment entry for the remote party.
109109
CustomRemoteCommitBlob tlv.Blob
110110

111-
// InitAuxLeaves is the set of aux leaves that'll be used for the very
112-
// first commitment state.
113-
InitAuxLeaves CommitAuxLeaves
111+
// LocalInitAuxLeaves is the set of aux leaves that'll be used for our
112+
// very first commitment state.
113+
LocalInitAuxLeaves CommitAuxLeaves
114+
115+
// RemoteInitAuxLeaves is the set of aux leaves that'll be used for the
116+
// very first commitment state for the remote party.
117+
RemoteInitAuxLeaves CommitAuxLeaves
114118
}
115119

116120
// InitFundingReserveMsg is the first message sent to initiate the workflow
@@ -1481,6 +1485,8 @@ func defaultCommitOpts() createCommitOpts {
14811485

14821486
// WithAuxLeaves is a functional option that can be used to set the aux leaves
14831487
// for a new commitment transaction.
1488+
//
1489+
// TODO(roasbeef): local+remote leaves
14841490
func WithAuxLeaves(leaves fn.Option[CommitAuxLeaves]) CreateCommitOpt {
14851491
return func(o *createCommitOpts) {
14861492
o.auxLeaves = leaves
@@ -2308,6 +2314,10 @@ func (l *LightningWallet) handleSingleFunderSigs(req *addSingleFunderSigsMsg) {
23082314
pendingReservation.Lock()
23092315
defer pendingReservation.Unlock()
23102316

2317+
// TODO(roasbeef): get funding desc
2318+
// * set all blobs
2319+
// * get the local+remote commitAux leaves for below commitment txns
2320+
23112321
chanState := pendingReservation.partialState
23122322
chanType := pendingReservation.partialState.ChanType
23132323
chanState.FundingOutpoint = *req.fundingOutpoint

0 commit comments

Comments
 (0)