utxonursery: report unconfirmed htlc on commit tx
This commit closes a reporting gap for htlc outputs on the remote commitment tx. Those are waited out by nursery, but were not reported before.
This commit is contained in:
parent
55aee9c703
commit
ca619bf680
@ -534,11 +534,18 @@ func (u *utxoNursery) NurseryReport(
|
|||||||
case input.CommitmentTimeLock:
|
case input.CommitmentTimeLock:
|
||||||
report.AddLimboCommitment(&kid)
|
report.AddLimboCommitment(&kid)
|
||||||
|
|
||||||
// An HTLC output on our commitment transaction
|
|
||||||
// where the second-layer transaction hasn't
|
|
||||||
// yet confirmed.
|
|
||||||
case input.HtlcAcceptedSuccessSecondLevel:
|
case input.HtlcAcceptedSuccessSecondLevel:
|
||||||
|
// An HTLC output on our commitment transaction
|
||||||
|
// where the second-layer transaction hasn't
|
||||||
|
// yet confirmed.
|
||||||
report.AddLimboStage1SuccessHtlc(&kid)
|
report.AddLimboStage1SuccessHtlc(&kid)
|
||||||
|
|
||||||
|
case input.HtlcOfferedRemoteTimeout:
|
||||||
|
// This is an HTLC output on the
|
||||||
|
// commitment transaction of the remote
|
||||||
|
// party. We are waiting for the CLTV
|
||||||
|
// timelock expire.
|
||||||
|
report.AddLimboDirectHtlc(&kid)
|
||||||
}
|
}
|
||||||
|
|
||||||
case bytes.HasPrefix(k, kndrPrefix):
|
case bytes.HasPrefix(k, kndrPrefix):
|
||||||
@ -1121,7 +1128,7 @@ func (c *contractMaturityReport) AddLimboStage1TimeoutHtlc(baby *babyOutput) {
|
|||||||
|
|
||||||
// AddLimboDirectHtlc adds a direct HTLC on the commitment transaction of the
|
// AddLimboDirectHtlc adds a direct HTLC on the commitment transaction of the
|
||||||
// remote party to the maturity report. This a CLTV time-locked output that
|
// remote party to the maturity report. This a CLTV time-locked output that
|
||||||
// hasn't yet expired.
|
// has or hasn't expired yet.
|
||||||
func (c *contractMaturityReport) AddLimboDirectHtlc(kid *kidOutput) {
|
func (c *contractMaturityReport) AddLimboDirectHtlc(kid *kidOutput) {
|
||||||
c.limboBalance += kid.Amount()
|
c.limboBalance += kid.Amount()
|
||||||
|
|
||||||
|
@ -664,12 +664,7 @@ func incubateTestOutput(t *testing.T, nursery *utxoNursery,
|
|||||||
if onLocalCommitment {
|
if onLocalCommitment {
|
||||||
expectedStage = 1
|
expectedStage = 1
|
||||||
}
|
}
|
||||||
|
assertNurseryReport(t, nursery, 1, expectedStage, 10000)
|
||||||
// TODO(joostjager): Nursery is currently not reporting this limbo
|
|
||||||
// balance.
|
|
||||||
if onLocalCommitment {
|
|
||||||
assertNurseryReport(t, nursery, 1, expectedStage, 10000)
|
|
||||||
}
|
|
||||||
|
|
||||||
return outgoingRes
|
return outgoingRes
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user