mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 22:24:21 +01:00
routing: Fix bugs with not sending routing messages
LIGHT-138, LIGHT-141. Due to some issues in sending/receiving parts of lnd, messages with zero length are not sent. So added some mock content to NeighborAck. Moved sender/receiver from routing message to wrap message which contains lnwire routing message.
This commit is contained in:
10
server.go
10
server.go
@@ -13,7 +13,6 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lndc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/roasbeef/btcd/btcec"
|
||||
"github.com/roasbeef/btcutil"
|
||||
|
||||
@@ -284,8 +283,11 @@ out:
|
||||
s.handleOpenChanReq(msg)
|
||||
}
|
||||
case msg := <-s.routingMgr.ChOut:
|
||||
msg1 := msg.(lnwire.RoutingMessage)
|
||||
receiverID := msg1.GetReceiverID().ToByte32()
|
||||
msg1 := msg.(*routing.RoutingMessage)
|
||||
if msg1.ReceiverID == nil{
|
||||
peerLog.Critical("msg1.GetReceiverID() == nil")
|
||||
}
|
||||
receiverID := msg1.ReceiverID.ToByte32()
|
||||
var targetPeer *peer
|
||||
for _, peer := range s.peers { // TODO: threadsafe api
|
||||
// We found the the target
|
||||
@@ -297,7 +299,7 @@ out:
|
||||
if targetPeer != nil {
|
||||
fndgLog.Info("Peer found. Sending message")
|
||||
done := make(chan struct{}, 1)
|
||||
targetPeer.queueMsg(msg.(lnwire.Message), done)
|
||||
targetPeer.queueMsg(msg1.Msg, done)
|
||||
} else {
|
||||
srvrLog.Errorf("Can't find peer to send message %v", receiverID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user