lnwallet+funding: pass the pending channel ID into the reservation context

In this commit, we start to thread the pending channel ID from wire
protocol all the way down into the reservation context. This change will
allow negotiation to take place _outside_ the protocol that may result
in a particular chanfunding.Assembler being dispatched.
This commit is contained in:
Olaoluwa Osuntokun committed 2019-12-02 17:11:46 -06:00
1 parent c3157ae2c4
commit 6e9cbc19f9
3 files changed
+19 -7

No files matched your search

+5 -1
View File
@@ -48,6 +48,10 @@ type InitFundingReserveMsg struct {
// target channel.
ChainHash *chainhash.Hash
// PendingChanID is the pending channel ID for this funding flow as
// used in the wire protocol.
PendingChanID [32]byte
// NodeID is the ID of the remote node we would like to open a channel
// with.
NodeID *btcec.PublicKey
@@ -513,7 +517,7 @@ func (l *LightningWallet) handleFundingReserveRequest(req *InitFundingReserveMsg
reservation, err := NewChannelReservation(
capacity, localFundingAmt, req.CommitFeePerKw, l, id,
req.PushMSat, l.Cfg.NetParams.GenesisHash, req.Flags,
req.Tweakless, req.ChanFunder,
req.Tweakless, req.ChanFunder, req.PendingChanID,
)
if err != nil {
if fundingIntent != nil {