Merge pull request #2108 from kcalvinalvin/2024-01-22-dont-update-mempool

netsync: don't update mempool/fee estimator unless we're synced up
This commit is contained in:
Olaoluwa Osuntokun 2024-02-26 16:19:51 -08:00 committed by GitHub
commit 5b6d265dd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1454,6 +1454,13 @@ func (sm *SyncManager) handleBlockchainNotification(notification *blockchain.Not
// A block has been connected to the main block chain.
case blockchain.NTBlockConnected:
// Don't attempt to update the mempool if we're not current.
// The mempool is empty and the fee estimator is useless unless
// we're caught up.
if !sm.current() {
return
}
block, ok := notification.Data.(*btcutil.Block)
if !ok {
log.Warnf("Chain connected notification is not a block.")