funding: send the next revocation key within the FundingLocked msg

This commit is contained in:
Olaoluwa Osuntokun committed 2017-02-24 16:32:17 -08:00
1 parent c1fbcae572
commit c55e5f708f
1 file changed
+13 -4
+13 -4
View File
@@ -953,17 +953,26 @@ func (f *fundingManager) waitForFundingConfirmation(
// With the block height and the transaction index known, we // With the block height and the transaction index known, we
// can construct the compact chainID which is used on the // can construct the compact chainID which is used on the
// network to unique identify channels. // network to unique identify channels.
// TODO(roasbeef): remove after spec change, no more chanID's!!!
chanID := lnwire.ChannelID{ chanID := lnwire.ChannelID{
BlockHeight: confDetails.BlockHeight, BlockHeight: confDetails.BlockHeight,
TxIndex: confDetails.TxIndex, TxIndex: confDetails.TxIndex,
TxPosition: uint16(fundingPoint.Index), TxPosition: uint16(fundingPoint.Index),
} }
// When the funding transaction has been confirmed, the FundingLocked // With the channel finally open, we'll now send over the funding
// message is sent to the remote peer so that the existence of the // locked message which marks that we consider the channel open by
// channel can be announced to the network. // presenting the remote party with our next revocation key. Without
// the revocation key, the remote party will be unable to propose state
// transitions.
nextRevocation, err := channel.NextRevocationkey()
if err != nil {
fndgLog.Errorf("unable to create next revocation: %v", err)
return
}
fundingLockedMsg := lnwire.NewFundingLocked(fundingPoint, chanID, fundingLockedMsg := lnwire.NewFundingLocked(fundingPoint, chanID,
f.cfg.IDKey) nextRevocation)
f.cfg.SendToPeer(completeChan.IdentityPub, fundingLockedMsg) f.cfg.SendToPeer(completeChan.IdentityPub, fundingLockedMsg)
return return