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 authored and Olaoluwa Osuntokun committed 2017-08-02 15:58:58 -07:00
1 parent 889a4eb48b
commit e2112702e7
3 files changed
+176 -46

No files matched your search

+11
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())