Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neutrino+query+rescan: improve rescan speed #236

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions neutrino.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,6 @@ type ChainService struct { // nolint:maligned
FilterCache *lru.Cache
BlockCache *lru.Cache

// queryPeers will be called to send messages to one or more peers,
// expecting a response.
queryPeers func(wire.Message, func(*ServerPeer, wire.Message,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

chan<- struct{}), ...QueryOption)

chainParams chaincfg.Params
addrManager *addrmgr.AddrManager
connManager *connmgr.ConnManager
Expand All @@ -597,6 +592,7 @@ type ChainService struct { // nolint:maligned
utxoScanner *UtxoScanner
broadcaster *pushtx.Broadcaster
banStore banman.Store
queryDispatcher query.Dispatcher
workManager *query.WorkManager

// peerSubscribers is a slice of active peer subscriptions, that we
Expand Down Expand Up @@ -679,12 +675,7 @@ func NewChainService(cfg Config) (*ChainService, error) {
Ranking: query.NewPeerRanking(),
})

// We set the queryPeers method to point to queryChainServicePeers,
// passing a reference to the newly created ChainService.
s.queryPeers = func(msg wire.Message, f func(*ServerPeer,
wire.Message, chan<- struct{}), qo ...QueryOption) {
queryChainServicePeers(&s, msg, f, qo...)
}
s.queryDispatcher = s.workManager

var err error

Expand Down
Loading