routing: fix bug introduced during switch to pubkeys in routing table

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.
This commit is contained in:
Olaoluwa Osuntokun 2016-10-23 18:38:05 -07:00
parent bb7f41933f
commit e6394a0862
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -3,6 +3,7 @@ package main
import ( import (
"bytes" "bytes"
"container/list" "container/list"
"encoding/hex"
"fmt" "fmt"
"net" "net"
"sync" "sync"
@ -400,8 +401,10 @@ out:
*lnwire.NeighborUpdMessage, *lnwire.NeighborUpdMessage,
*lnwire.RoutingTableRequestMessage, *lnwire.RoutingTableRequestMessage,
*lnwire.RoutingTableTransferMessage: *lnwire.RoutingTableTransferMessage:
// Convert to base routing message and set sender and receiver // 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 { if isChanUpdate {