mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 05:42:37 +02:00
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:
committed by
Olaoluwa Osuntokun
parent
889a4eb48b
commit
e2112702e7
11
lnd.go
11
lnd.go
@@ -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())
|
||||
|
Reference in New Issue
Block a user