Skip to content

Commit

Permalink
Merge pull request #515 from bhandras/sweep-tx-log
Browse files Browse the repository at this point in the history
loopout: log failed sweeps for more detail
  • Loading branch information
bhandras authored Jul 27, 2022
2 parents 535b84c + a9dbaee commit e8d6d3c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions loopout.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package loop

import (
"bytes"
"context"
"crypto/rand"
"crypto/sha256"
Expand Down Expand Up @@ -1557,7 +1558,14 @@ func (s *loopOutSwap) sweepMuSig2(ctx context.Context,
labels.LoopOutSweepSuccess(swap.ShortHash(&s.hash)),
)
if err != nil {
s.log.Warnf("Publish of MuSig2 sweep failed: %v", err)
var sweepTxBuf bytes.Buffer
if err := sweepTx.Serialize(&sweepTxBuf); err != nil {
s.log.Warnf("Unable to serialize sweep txn: %v", err)
}

s.log.Warnf("Publish of MuSig2 sweep failed: %v. Raw tx: %x",
err, sweepTxBuf.Bytes())

return false
}

Expand Down Expand Up @@ -1637,7 +1645,13 @@ func (s *loopOutSwap) sweep(ctx context.Context, htlcOutpoint wire.OutPoint,
labels.LoopOutSweepSuccess(swap.ShortHash(&s.hash)),
)
if err != nil {
s.log.Warnf("Publish sweep: %v", err)
var sweepTxBuf bytes.Buffer
if err := sweepTx.Serialize(&sweepTxBuf); err != nil {
s.log.Warnf("Unable to serialize sweep txn: %v", err)
}

s.log.Warnf("Publish sweep failed: %v. Raw tx: %x",
err, sweepTxBuf.Bytes())
}

return nil
Expand Down

0 comments on commit e8d6d3c

Please sign in to comment.