sweep+utxonursery+cnct+breacharbiter: add height hint to input
This commit is a preparation for the implementation of remote spend detection. Remote spends may happen before we broadcast our own sweep tx. This calls for accurate height hints.
This commit is contained in:
5 files changed
+43
-13
No files matched your search
+6
-3
@@ -1554,8 +1554,6 @@ type kidOutput struct {
|
||||
// NOTE: This will only be set for: outgoing HTLC's on the commitment
|
||||
// transaction of the remote party.
|
||||
absoluteMaturity uint32
|
||||
|
||||
confHeight uint32
|
||||
}
|
||||
|
||||
func makeKidOutput(outpoint, originChanPoint *wire.OutPoint,
|
||||
@@ -1569,9 +1567,14 @@ func makeKidOutput(outpoint, originChanPoint *wire.OutPoint,
|
||||
isHtlc := (witnessType == lnwallet.HtlcAcceptedSuccessSecondLevel ||
|
||||
witnessType == lnwallet.HtlcOfferedRemoteTimeout)
|
||||
|
||||
// heightHint can be safely set to zero here, because after this
|
||||
// function returns, nursery will set a proper confirmation height in
|
||||
// waitForTimeoutConf or waitForPreschoolConf.
|
||||
heightHint := uint32(0)
|
||||
|
||||
return kidOutput{
|
||||
breachedOutput: makeBreachedOutput(
|
||||
outpoint, witnessType, nil, signDescriptor,
|
||||
outpoint, witnessType, nil, signDescriptor, heightHint,
|
||||
),
|
||||
isHtlc: isHtlc,
|
||||
originChanPoint: *originChanPoint,
|
||||
|
||||
Reference in new issue
Block a user