mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
Merge branch '0-19-2-branch-rc1-9921' into 0-19-2-branch-rc1
This commit is contained in:
@@ -833,8 +833,16 @@ func (b *BitcoindNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if uint32(blockHeight) > ntfn.HistoricalDispatch.StartHeight {
|
||||
ntfn.HistoricalDispatch.StartHeight = uint32(blockHeight)
|
||||
spentHeight := uint32(blockHeight)
|
||||
chainntnfs.Log.Debugf("Outpoint(%v) has spent at height %v",
|
||||
outpoint, spentHeight)
|
||||
|
||||
// Since the tx has already been spent at spentHeight, the
|
||||
// heightHint specified by the caller is no longer relevant. We
|
||||
// now update the starting height to be the spent height to make
|
||||
// sure we won't miss it in the rescan.
|
||||
if spentHeight != ntfn.HistoricalDispatch.StartHeight {
|
||||
ntfn.HistoricalDispatch.StartHeight = spentHeight
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -933,15 +933,25 @@ func (b *BtcdNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
|
||||
"block %v: %v", blockHash, err)
|
||||
}
|
||||
|
||||
if uint32(blockHeader.Height) > ntfn.HistoricalDispatch.StartHeight {
|
||||
spentHeight := uint32(blockHeader.Height)
|
||||
chainntnfs.Log.Debugf("Outpoint(%v) has spent at height %v",
|
||||
outpoint, spentHeight)
|
||||
|
||||
// Since the tx has already been spent at spentHeight, the
|
||||
// heightHint specified by the caller is no longer relevant. We
|
||||
// now update the starting height to be the spent height to make
|
||||
// sure we won't miss it in the rescan.
|
||||
if spentHeight != ntfn.HistoricalDispatch.StartHeight {
|
||||
startHash, err = b.chainConn.GetBlockHash(
|
||||
int64(blockHeader.Height),
|
||||
int64(spentHeight),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to get block "+
|
||||
"hash for height %d: %v",
|
||||
blockHeader.Height, err)
|
||||
}
|
||||
|
||||
ntfn.HistoricalDispatch.StartHeight = spentHeight
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,9 @@
|
||||
- [Use](https://github.com/lightningnetwork/lnd/pull/9889) `BigSizeT` instead of
|
||||
`uint16` for the htlc index that's used in the revocation log.
|
||||
|
||||
- [Fixed](https://github.com/lightningnetwork/lnd/pull/9921) a case where the
|
||||
spending notification of an output may be missed if wrong height hint is used.
|
||||
|
||||
# New Features
|
||||
|
||||
## Functional Enhancements
|
||||
|
Reference in New Issue
Block a user