diff --git a/lntemp/harness.go b/lntemp/harness.go index 700ab68cb..07e0a4966 100644 --- a/lntemp/harness.go +++ b/lntemp/harness.go @@ -172,7 +172,7 @@ func (h *HarnessTest) SetupStandbyNodes() { // each. nodes := []*node.HarnessNode{h.Alice, h.Bob} for _, hn := range nodes { - h.manager.standbyNodes[hn.PubKeyStr] = hn + h.manager.standbyNodes[hn.Cfg.NodeID] = hn for i := 0; i < 10; i++ { resp := hn.RPC.NewAddress(addrReq) @@ -342,9 +342,9 @@ func (h *HarnessTest) Subtest(t *testing.T) (*HarnessTest, func()) { // shutdownNonStandbyNodes will shutdown any non-standby nodes. func (h *HarnessTest) shutdownNonStandbyNodes() { - for pks, node := range h.manager.activeNodes { + for nid, node := range h.manager.activeNodes { // If it's a standby node, skip. - _, ok := h.manager.standbyNodes[pks] + _, ok := h.manager.standbyNodes[nid] if ok { continue } diff --git a/lntemp/harness_node_manager.go b/lntemp/harness_node_manager.go index a16375353..3cf8469a9 100644 --- a/lntemp/harness_node_manager.go +++ b/lntemp/harness_node_manager.go @@ -33,11 +33,11 @@ type nodeManager struct { // activeNodes is a map of all running nodes, format: // {pubkey: *HarnessNode}. - activeNodes map[string]*node.HarnessNode + activeNodes map[uint32]*node.HarnessNode // standbyNodes is a map of all the standby nodes, format: // {pubkey: *HarnessNode}. - standbyNodes map[string]*node.HarnessNode + standbyNodes map[uint32]*node.HarnessNode // nodeCounter is a monotonically increasing counter that's used as the // node's unique ID. @@ -54,8 +54,8 @@ func newNodeManager(lndBinary string, return &nodeManager{ lndBinary: lndBinary, dbBackend: dbBackend, - activeNodes: make(map[string]*node.HarnessNode), - standbyNodes: make(map[string]*node.HarnessNode), + activeNodes: make(map[uint32]*node.HarnessNode), + standbyNodes: make(map[uint32]*node.HarnessNode), } } @@ -126,7 +126,7 @@ func (nm *nodeManager) newNode(t *testing.T, name string, extraArgs []string, // retrieved their public keys via FetchNodeInfo. func (nm *nodeManager) registerNode(node *node.HarnessNode) { nm.Lock() - nm.activeNodes[node.PubKeyStr] = node + nm.activeNodes[node.Cfg.NodeID] = node nm.Unlock() } @@ -137,7 +137,7 @@ func (nm *nodeManager) shutdownNode(node *node.HarnessNode) error { return err } - delete(nm.activeNodes, node.PubKeyStr) + delete(nm.activeNodes, node.Cfg.NodeID) return nil }