mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
mod+loopin+loopout: update lndclient, add labels to TXs
We update to the latest lndclient that now requires a label when publishing an on-chain transaction. Instead of just adding an empty string, we use the proper labels added in a previous commit.
This commit is contained in:
parent
3a3571ba6f
commit
38ddbfb45d
5 changed files with 31 additions and 11 deletions
13
loopin.go
13
loopin.go
|
|
@ -14,6 +14,7 @@ import (
|
|||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightninglabs/lndclient"
|
||||
"github.com/lightninglabs/loop/labels"
|
||||
"github.com/lightninglabs/loop/loopdb"
|
||||
"github.com/lightninglabs/loop/swap"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
|
|
@ -652,12 +653,11 @@ func (s *loopInSwap) publishOnChainHtlc(ctx context.Context) (bool, error) {
|
|||
s.log.Infof("Publishing on chain HTLC with fee rate %v", feeRate)
|
||||
|
||||
// Internal loop-in is always P2WSH.
|
||||
tx, err := s.lnd.WalletKit.SendOutputs(ctx,
|
||||
[]*wire.TxOut{{
|
||||
tx, err := s.lnd.WalletKit.SendOutputs(
|
||||
ctx, []*wire.TxOut{{
|
||||
PkScript: s.htlcP2WSH.PkScript,
|
||||
Value: int64(s.LoopInContract.AmountRequested),
|
||||
}},
|
||||
feeRate,
|
||||
}}, feeRate, labels.LoopInHtlcLabel(swap.ShortHash(&s.hash)),
|
||||
)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("send outputs: %v", err)
|
||||
|
|
@ -874,7 +874,10 @@ func (s *loopInSwap) publishTimeoutTx(ctx context.Context,
|
|||
s.log.Infof("Publishing timeout tx %v with fee %v to addr %v",
|
||||
timeoutTxHash, fee, s.timeoutAddr)
|
||||
|
||||
err = s.lnd.WalletKit.PublishTransaction(ctx, timeoutTx)
|
||||
err = s.lnd.WalletKit.PublishTransaction(
|
||||
ctx, timeoutTx,
|
||||
labels.LoopInSweepTimeout(swap.ShortHash(&s.hash)),
|
||||
)
|
||||
if err != nil {
|
||||
s.log.Warnf("publish timeout: %v", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue