Skip to content

Commit cdadcab

Browse files
committed
tapchannel: remove unnecessary witness update
We always add the witness to the commitment TX before we create any of the commitment outputs. So this witness should already be correct.
1 parent b31954f commit cdadcab

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

tapchannel/aux_sweeper.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,6 @@ func (a *AuxSweeper) createSweepVpackets(sweepInputs []*cmsg.AssetOutput,
292292
log.Infof("Created %v sweep packets: %v", len(vPackets),
293293
limitSpewer.Sdump(vPackets))
294294

295-
fundingWitness, err := fundingSpendWitness().Unpack()
296-
if err != nil {
297-
return lfn.Errf[returnType]("unable to make funding witness: "+
298-
"%w", err)
299-
}
300-
301295
// Next, we'll prepare all the vPackets for the sweep transaction, and
302296
// also set the courier address.
303297
courierAddr := a.cfg.DefaultCourierAddr
@@ -324,16 +318,6 @@ func (a *AuxSweeper) createSweepVpackets(sweepInputs []*cmsg.AssetOutput,
324318
"assets: %w", err)
325319
}
326320

327-
// Next before we sign, we'll make sure to update the witness
328-
// of the prev asset's root asset. Otherwise, we'll be signing
329-
// the wrong input leaf.
330-
vIn := vPackets[idx].Inputs[0]
331-
if vIn.Asset().HasSplitCommitmentWitness() {
332-
//nolint:lll
333-
rootAsset := vIn.Asset().PrevWitnesses[0].SplitCommitment.RootAsset
334-
rootAsset.PrevWitnesses[0].TxWitness = fundingWitness
335-
}
336-
337321
for outIdx := range vPackets[idx].Outputs {
338322
//nolint:lll
339323
vPackets[idx].Outputs[outIdx].ProofDeliveryAddress = courierAddr

0 commit comments

Comments
 (0)