utxonursery: pass broadcastHeight to registerPreschoolConf
In this commit IncubateOutputs are given an extra parameter broadcastHeight, which is passed from the server and used when called registerPresschoolConf. Earlier the utxonursery used the bestHeight as height hint in this case, which would be wrong in the cases where we got outputs for incubation which was confirmed below the best height.
This commit is contained in:
parent
3a67fe2552
commit
0a5f982280
@ -644,6 +644,7 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB, cc *chainControl,
|
||||
|
||||
return s.utxoNursery.IncubateOutputs(
|
||||
chanPoint, commitRes, outRes, inRes,
|
||||
broadcastHeight,
|
||||
)
|
||||
},
|
||||
PreimageDB: s.witnessBeacon,
|
||||
|
@ -343,7 +343,8 @@ func (u *utxoNursery) Stop() error {
|
||||
func (u *utxoNursery) IncubateOutputs(chanPoint wire.OutPoint,
|
||||
commitResolution *lnwallet.CommitOutputResolution,
|
||||
outgoingHtlcs []lnwallet.OutgoingHtlcResolution,
|
||||
incomingHtlcs []lnwallet.IncomingHtlcResolution) error {
|
||||
incomingHtlcs []lnwallet.IncomingHtlcResolution,
|
||||
broadcastHeight uint32) error {
|
||||
|
||||
numHtlcs := len(incomingHtlcs) + len(outgoingHtlcs)
|
||||
var (
|
||||
@ -469,7 +470,9 @@ func (u *utxoNursery) IncubateOutputs(chanPoint wire.OutPoint,
|
||||
// kindergarten bucket.
|
||||
if len(kidOutputs) != 0 {
|
||||
for _, kidOutput := range kidOutputs {
|
||||
err := u.registerPreschoolConf(&kidOutput, u.bestHeight)
|
||||
err := u.registerPreschoolConf(
|
||||
&kidOutput, broadcastHeight,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user