Skip to content

Commit 3950106

Browse files
committed
Revert "loopd: avoid panic if asset client is not set"
This reverts commit d12dc03.
1 parent 1104e92 commit 3950106

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

loopd/swapclient_server.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -418,20 +418,11 @@ func (s *swapClientServer) marshallSwap(ctx context.Context,
418418
outGoingChanSet = loopSwap.OutgoingChanSet
419419

420420
if loopSwap.AssetSwapInfo != nil {
421-
var (
422-
// Default the asset name to "N/A" in case we
423-
// can't fetch it due to the asset client not
424-
// being set.
425-
assetName string = "N/A"
426-
err error
421+
assetName, err := s.assetClient.GetAssetName(
422+
ctx, loopSwap.AssetSwapInfo.AssetId,
427423
)
428-
if s.assetClient != nil {
429-
assetName, err = s.assetClient.GetAssetName(
430-
ctx, loopSwap.AssetSwapInfo.AssetId,
431-
)
432-
if err != nil {
433-
return nil, err
434-
}
424+
if err != nil {
425+
return nil, err
435426
}
436427

437428
assetInfo = &looprpc.AssetLoopOutInfo{

0 commit comments

Comments
 (0)