fundingManager: use NotifyWhenOnline when sending fundingLocked.

The fundingManager will register with the server to get notified
when the targetted peer comes online, in case of a failed send
of the fundingLocked message. This is necessary because if the
peer is not connected yet (or was disconnected while we were
waiting for the funding tx to confirm), we cannot continue the
the opening process before the peer successfully has received
the fundingLocked.
This commit is contained in:
Johan T. Halseth
2017-09-25 00:01:05 +02:00
parent 4b4c431d67
commit b8cadf881c
2 changed files with 45 additions and 10 deletions

9
lnd.go
View File

@ -186,10 +186,11 @@ func lndMain() error {
idPrivKey.PubKey())
return <-errChan
},
ArbiterChan: server.breachArbiter.newContracts,
SendToPeer: server.SendToPeer,
FindPeer: server.FindPeer,
TempChanIDSeed: chanIDSeed,
ArbiterChan: server.breachArbiter.newContracts,
SendToPeer: server.SendToPeer,
NotifyWhenOnline: server.NotifyWhenOnline,
FindPeer: server.FindPeer,
TempChanIDSeed: chanIDSeed,
FindChannel: func(chanID lnwire.ChannelID) (*lnwallet.LightningChannel, error) {
dbChannels, err := chanDB.FetchAllChannels()
if err != nil {