funding: modify channel announcements due to lnwire API change

This commit is contained in:
Olaoluwa Osuntokun 2017-03-05 22:46:49 -06:00
parent 743de45c92
commit 1e540b0f99
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -911,10 +911,10 @@ func (f *fundingManager) waitForFundingConfirmation(
return return
} }
// Now that the channel is open, we need to notify a number of // Now that the channel is open, we need to notify a number of parties
// parties of this event. // of this event.
// First we send the newly opened channel to the source server // First we send the newly opened channel to the source peer.
peer, err := f.cfg.FindPeer(completeChan.IdentityPub) peer, err := f.cfg.FindPeer(completeChan.IdentityPub)
if err != nil { if err != nil {
fndgLog.Errorf("Unable to find peer: %v", err) fndgLog.Errorf("Unable to find peer: %v", err)
@ -936,23 +936,22 @@ func (f *fundingManager) waitForFundingConfirmation(
case <-newChanDone: // Fallthrough if we're not quitting. case <-newChanDone: // Fallthrough if we're not quitting.
} }
// Close the active channel barrier signalling the // Close the active channel barrier signalling the readHandler that
// readHandler that commitment related modifications to // commitment related modifications to this channel can now proceed.
// this channel can now proceed.
f.barrierMtx.Lock() f.barrierMtx.Lock()
fndgLog.Tracef("Closing chan barrier for ChannelPoint(%v)", fundingPoint) fndgLog.Tracef("Closing chan barrier for ChannelPoint(%v)", fundingPoint)
close(f.newChanBarriers[fundingPoint]) close(f.newChanBarriers[fundingPoint])
delete(f.newChanBarriers, fundingPoint) delete(f.newChanBarriers, fundingPoint)
f.barrierMtx.Unlock() f.barrierMtx.Unlock()
// Afterwards we send the breach arbiter the new channel so it // Afterwards we send the breach arbiter the new channel so it can
// can watch for attempts to breach the channel's contract by // watch for attempts to breach the channel's contract by the remote
// the remote party. // party.
f.cfg.ArbiterChan <- channel f.cfg.ArbiterChan <- channel
// With the block height and the transaction index known, we // With the block height and the transaction index known, we can
// can construct the compact chainID which is used on the // construct the compact chainID which is used on the network to unique
// network to unique identify channels. // identify channels.
// TODO(roasbeef): remove after spec change, no more chanID's!!! // TODO(roasbeef): remove after spec change, no more chanID's!!!
chanID := lnwire.ChannelID{ chanID := lnwire.ChannelID{
BlockHeight: confDetails.BlockHeight, BlockHeight: confDetails.BlockHeight,
@ -1081,7 +1080,7 @@ func newChanAnnouncement(localIdentity, remotePub *btcec.PublicKey,
ChannelID: chanID, ChannelID: chanID,
Timestamp: uint32(time.Now().Unix()), Timestamp: uint32(time.Now().Unix()),
Flags: chanFlags, Flags: chanFlags,
Expiry: 1, TimeLockDelta: 1,
HtlcMinimumMstat: 0, HtlcMinimumMstat: 0,
FeeBaseMstat: 0, FeeBaseMstat: 0,
FeeProportionalMillionths: 0, FeeProportionalMillionths: 0,