Skip to content

Commit 64328da

Browse files
committed
tapgarden: fix logging on addr import
1 parent d09b3bf commit 64328da

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tapgarden/caretaker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ func (b *BatchCaretaker) stateStep(currentState BatchState) (BatchState, error)
785785
case strings.Contains(err.Error(), "already exists"):
786786
break
787787

788-
case err != nil:
788+
default:
789789
return 0, fmt.Errorf("unable to import key: %w", err)
790790
}
791791

tapgarden/custodian.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,15 @@ func (c *Custodian) importAddrToWallet(addr *address.AddrWithKeyInfo) error {
547547
// along if so.
548548
case strings.Contains(err.Error(), "already exists"):
549549

550-
case err != nil:
550+
default:
551551
return err
552552
}
553553

554-
log.Infof("Imported Taproot Asset address %v into wallet, watching "+
555-
"p2tr address %v on chain", addrStr, p2trAddr.String())
554+
log.Infof("Imported Taproot Asset address %v into wallet", addrStr)
555+
if p2trAddr != nil {
556+
log.Infof("watching p2tr address %v on chain",
557+
p2trAddr.String())
558+
}
556559

557560
return c.cfg.AddrBook.SetAddrManaged(ctxt, addr, time.Now())
558561
}

0 commit comments

Comments
 (0)