@@ -206,22 +206,26 @@ func (a *AuxSweeper) createSweepVpackets(sweepInputs []*cmsg.AssetOutput,
206206 // the output information locked in, as this was a pre-signed
207207 // transaction.
208208 if sweepDesc .auxSigInfo .IsSome () {
209+ log .Infof ("Re-creating second level HTLC vPkt to " +
210+ "spend: %v" , resReq .ContractPoint )
211+
209212 var cltvTimeout fn.Option [uint32 ]
210213 sweepDesc .absoluteDelay .WhenSome (func (delay uint64 ) {
211214 cltvTimeout = fn .Some (uint32 (delay ))
212215 })
213216
217+ // When we create the 2nd level allocation, we set the output
218+ // index to be None, as we don't know exactly _where_ on the
219+ // sweep transaction this output will lie.
214220 alloc , err := createSecondLevelHtlcAllocations (
215221 resReq .ChanType , resReq .Initiator , sweepInputs ,
216222 resReq .HtlcAmt , resReq .CommitCsvDelay , * resReq .KeyRing ,
217- fn .Some ( resReq . ContractPoint . Index ), cltvTimeout ,
223+ fn .None [ uint32 ]( ), cltvTimeout ,
218224 )
219225 if err != nil {
220226 return lfn.Err [returnType ](err )
221227 }
222228
223- // TODO(roasbeef): allocation needs precise output index set?
224-
225229 allocs = append (allocs , alloc ... )
226230 } else {
227231 // Otherwise, for each out we want to sweep, we'll construct an
0 commit comments