From b7e5c0b449a8a47da28d636f61d4fbdd14d49c64 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 21 Mar 2022 14:49:10 +0100 Subject: [PATCH] sweep: always send signed output's pk script Fixes #457. The SignOutputRaw RPC is normally too lenient when it comes to fields not being set, which is why this used to work previously. But with lnd in remote signing mode, we need all the extra meta information available on an input being signed for, so we actually need the pk script being set. Loop fully works with a remote signing lnd backend pair after applying this fix. --- sweep/sweeper.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sweep/sweeper.go b/sweep/sweeper.go index c22b8da..0c409c3 100644 --- a/sweep/sweeper.go +++ b/sweep/sweeper.go @@ -61,7 +61,8 @@ func (s *Sweeper) CreateSweepTx( signDesc := lndclient.SignDescriptor{ WitnessScript: htlc.Script(), Output: &wire.TxOut{ - Value: int64(amount), + Value: int64(amount), + PkScript: htlc.PkScript, }, HashType: txscript.SigHashAll, InputIndex: 0,