utxonursery: use baby expiry as height hint

Previously we would use the best known height as height hint, which
could lead to using a height hint above the actual block it confirms,
hence losing track of the confirmation.
This commit is contained in:
Johan T. Halseth 2019-02-04 12:28:31 +01:00
parent 5d7bb7406f
commit 9d9d148262
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

View File

@ -457,7 +457,7 @@ func (u *utxoNursery) IncubateOutputs(chanPoint wire.OutPoint,
// it. This may happen if the caller raced a block to call this method.
for _, babyOutput := range babyOutputs {
if uint32(bestHeight) >= babyOutput.expiry {
err = u.sweepCribOutput(uint32(bestHeight), &babyOutput)
err = u.sweepCribOutput(babyOutput.expiry, &babyOutput)
if err != nil {
return err
}