Skip to content

Commit 4e5763c

Browse files
committed
backend/btc: log some panics to log.txt instead of stderr
1 parent 651133c commit 4e5763c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backend/coins/btc/transactions/transactions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func (transactions *Transactions) getTransactionCached(
330330
}
331331
tx, err := transactions.blockchain.TransactionGet(txHash)
332332
if err != nil {
333-
panic(err)
333+
transactions.log.WithError(err).Panic("TransactionGet failed")
334334
}
335335
return tx
336336
}
@@ -385,7 +385,7 @@ func (transactions *Transactions) txInfo(
385385
spentOut, err := dbTx.Output(txIn.PreviousOutPoint)
386386
if err != nil {
387387
// TODO
388-
panic(err)
388+
transactions.log.WithError(err).Panic("Output() failed")
389389
}
390390
if spentOut != nil {
391391
sumOurInputs += btcutil.Amount(spentOut.Value)
@@ -405,7 +405,7 @@ func (transactions *Transactions) txInfo(
405405
})
406406
if err != nil {
407407
// TODO
408-
panic(err)
408+
transactions.log.WithError(err).Panic("Output() failed")
409409
}
410410
addressAndAmount := accounts.AddressAndAmount{
411411
Address: transactions.outputToAddress(txOut.PkScript),

0 commit comments

Comments
 (0)