fundingmanager: send node announcements after channel open.

Make the fundingmanager send an updated node announcement
each time it opens a new channel. This is to make sure
our node announcement is propagated in the network, since
peers will ignore our node announcements if we haven't
opened any channels yet.
This commit is contained in:
Johan T. Halseth
2017-07-14 21:47:52 +02:00
committed by Olaoluwa Osuntokun
parent 889a4eb48b
commit e2112702e7
3 changed files with 176 additions and 46 deletions

11
lnd.go
View File

@@ -18,6 +18,7 @@ import (
flags "github.com/btcsuite/go-flags"
proxy "github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/discovery"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
@@ -130,6 +131,16 @@ func lndMain() error {
pubKey, msg,
)
},
SignNodeAnnouncement: func(nodeAnn *lnwire.NodeAnnouncement) (*btcec.Signature, error) {
sig, err := discovery.SignAnnouncement(nodeSigner,
server.identityPriv.PubKey(),
nodeAnn,
)
if err != nil {
return nil, err
}
return sig, nil
},
SendAnnouncement: func(msg lnwire.Message) error {
server.discoverSrv.ProcessLocalAnnouncement(msg,
idPrivKey.PubKey())