discovery: update usage of d.cfg.Broadcast to reflect recent API change
When broadcasting a set of messages, we must now call broadcast for each (msg, …senders) tuple, rather than just calling it once for the entire batch.
This commit is contained in:
parent
702bf7be29
commit
68dabe3594
@ -83,7 +83,8 @@ type Config struct {
|
|||||||
// that the daemon is connected to. If supplied, the exclude parameter
|
// that the daemon is connected to. If supplied, the exclude parameter
|
||||||
// indicates that the target peer should be excluded from the
|
// indicates that the target peer should be excluded from the
|
||||||
// broadcast.
|
// broadcast.
|
||||||
Broadcast func(exclude *btcec.PublicKey, msg ...lnwire.Message) error
|
Broadcast func(skips map[routing.Vertex]struct{},
|
||||||
|
msg ...lnwire.Message) error
|
||||||
|
|
||||||
// SendToPeer is a function which allows the service to send a set of
|
// SendToPeer is a function which allows the service to send a set of
|
||||||
// messages to a particular peer identified by the target public key.
|
// messages to a particular peer identified by the target public key.
|
||||||
@ -912,11 +913,15 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
|||||||
|
|
||||||
// If we have new things to announce then broadcast
|
// If we have new things to announce then broadcast
|
||||||
// them to all our immediately connected peers.
|
// them to all our immediately connected peers.
|
||||||
err := d.cfg.Broadcast(nil, announcementBatch...)
|
for _, msgChunk := range announcementBatch {
|
||||||
if err != nil {
|
err := d.cfg.Broadcast(
|
||||||
log.Errorf("unable to send batch "+
|
msgChunk.senders, msgChunk.msg,
|
||||||
"announcements: %v", err)
|
)
|
||||||
continue
|
if err != nil {
|
||||||
|
log.Errorf("unable to send batch "+
|
||||||
|
"announcements: %v", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're able to broadcast the current batch
|
// If we're able to broadcast the current batch
|
||||||
|
Loading…
Reference in New Issue
Block a user