From e6394a0862e0467483df7bae1776ea8dfeac1f1d Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 23 Oct 2016 18:38:05 -0700 Subject: [PATCH] routing: fix bug introduced during switch to pubkeys in routing table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes a bug which was introduced when the routing table was switched over to store full pub keys rather then public key hashes. The switch was change was required in order to properly support onion routing within the daemon. During the change the source node vertex when receiving a message wasn’t converted to use public keys instead of pubkeyhashes. As a result, nodes would be blind to any topology related updates sent by its neighbors. This commit fixes the bug by setting the source node of the received message to the serialized public key rather than the pubkeyhash. --- peer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/peer.go b/peer.go index d0c02efb..bc40faea 100644 --- a/peer.go +++ b/peer.go @@ -3,6 +3,7 @@ package main import ( "bytes" "container/list" + "encoding/hex" "fmt" "net" "sync" @@ -400,8 +401,10 @@ out: *lnwire.NeighborUpdMessage, *lnwire.RoutingTableRequestMessage, *lnwire.RoutingTableTransferMessage: + // Convert to base routing message and set sender and receiver - p.server.routingMgr.ReceiveRoutingMessage(msg, graph.NewID(([32]byte)(p.lightningID))) + vertex := hex.EncodeToString(p.identityPub.SerializeCompressed()) + p.server.routingMgr.ReceiveRoutingMessage(msg, graph.NewID(vertex)) } if isChanUpdate {