multi: add new method to generate fresh node announcments

This commit is contained in:
Olaoluwa Osuntokun
2017-08-04 18:32:25 -07:00
parent 6307f7243e
commit 43b736225b
7 changed files with 80 additions and 99 deletions

12
lnd.go
View File

@@ -20,7 +20,6 @@ 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"
@@ -137,15 +136,8 @@ 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
CurrentNodeAnnouncement: func() (*lnwire.NodeAnnouncement, error) {
return server.genNodeAnnouncement(true)
},
SendAnnouncement: func(msg lnwire.Message) error {
server.discoverSrv.ProcessLocalAnnouncement(msg,