Merge pull request #7471 from hieblmi/peer-alias-remove-error

rpc: assign peer alias lookup error string
This commit is contained in:
Oliver Gugger 2023-03-03 11:48:13 +01:00 committed by GitHub
commit 2e9ceb2ceb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View File

@ -149,6 +149,10 @@ of order is also [fixed](https://github.com/lightningnetwork/lnd/pull/7264).
parameter is enabled by default but can be disabled with a new flag
`--skip_peer_alias_lookup`.
* Assign potential peer alias lookup errors in the [`ListChannels` and
`ForwardingHistory`rpcs](https://github.com/lightningnetwork/lnd/pull/7471) to
the rpc response.
## Wallet
* [Allows Taproot public keys and tap scripts to be imported as watch-only

View File

@ -4176,8 +4176,8 @@ func createRPCOpenChannel(r *rpcServer, dbChannel *channeldb.OpenChannel,
if peerAliasLookup {
peerAlias, err := r.server.graphDB.LookupAlias(nodePub)
if err != nil {
return nil, fmt.Errorf("unable to lookup peer "+
"alias: %w", err)
peerAlias = fmt.Sprintf("unable to lookup "+
"peer alias: %v", err)
}
channel.PeerAlias = peerAlias
}
@ -7018,16 +7018,15 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
if req.PeerAliasLookup {
aliasIn, err := getRemoteAlias(event.IncomingChanID)
if err != nil {
return nil, fmt.Errorf("unable to lookup peer "+
aliasIn = fmt.Sprintf("unable to lookup peer "+
"alias: %v", err)
}
aliasOut, err := getRemoteAlias(event.OutgoingChanID)
if err != nil {
aliasOut = fmt.Sprintf("unable to lookup peer"+
"alias: %v", err)
}
resp.ForwardingEvents[i].PeerAliasIn = aliasIn
aliasOut, err := getRemoteAlias(event.OutgoingChanID)
if err != nil {
return nil, fmt.Errorf("unable to lookup peer "+
"alias: %v", err)
}
resp.ForwardingEvents[i].PeerAliasOut = aliasOut
}
}