From c9bc10ef7617ed8d7b289b7fce8158863f93157a Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Fri, 10 Jun 2022 17:06:32 +0200 Subject: [PATCH] sweep: fill sign method when script spending a taproot htlc --- sweep/sweeper.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sweep/sweeper.go b/sweep/sweeper.go index 3e06e9b..775fe19 100644 --- a/sweep/sweeper.go +++ b/sweep/sweeper.go @@ -71,6 +71,13 @@ func (s *Sweeper) CreateSweepTx( }, } + // Update the sign method from the default witness_v0 if this is a + // taproot htlc. Note that we'll always be doing script spend when + // sweeping a taproot htlc using the CreateSweepTx function. + if htlc.Version == swap.HtlcV3 { + signDesc.SignMethod = input.TaprootScriptSpendSignMethod + } + // We need our previous outputs for taproot spends, and there's no // harm including them for segwit v0, so we always include our prevOut. prevOut := []*wire.TxOut{