fix check node1Err !=nil but return a nil value error err

Signed-off-by: alingse <alingse@foxmail.com>
This commit is contained in:
alingse
2024-12-19 14:57:28 +00:00
parent 2d629174e7
commit a79fd08294
2 changed files with 4 additions and 4 deletions

View File

@@ -85,12 +85,12 @@ func establishTestConnection(t testing.TB) (net.Conn, net.Conn, error) {
remote := <-remoteConnChan remote := <-remoteConnChan
if remote.err != nil { if remote.err != nil {
return nil, nil, err return nil, nil, remote.err
} }
local := <-localConnChan local := <-localConnChan
if local.err != nil { if local.err != nil {
return nil, nil, err return nil, nil, local.err
} }
t.Cleanup(func() { t.Cleanup(func() {

View File

@@ -1130,7 +1130,7 @@ func (c *ChannelGraph) addChannelEdge(tx kvdb.RwTx,
"for: %x: %w", edge.NodeKey1Bytes, err) "for: %x: %w", edge.NodeKey1Bytes, err)
} }
case node1Err != nil: case node1Err != nil:
return err return node1Err
} }
_, node2Err := fetchLightningNode(nodes, edge.NodeKey2Bytes[:]) _, node2Err := fetchLightningNode(nodes, edge.NodeKey2Bytes[:])
@@ -1146,7 +1146,7 @@ func (c *ChannelGraph) addChannelEdge(tx kvdb.RwTx,
"for: %x: %w", edge.NodeKey2Bytes, err) "for: %x: %w", edge.NodeKey2Bytes, err)
} }
case node2Err != nil: case node2Err != nil:
return err return node2Err
} }
// If the edge hasn't been created yet, then we'll first add it to the // If the edge hasn't been created yet, then we'll first add it to the