mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 01:40:07 +01:00
multi: rebase to upstream, update API's
This commit is contained in:
parent
6f32a79fd6
commit
10432160d5
@ -299,6 +299,6 @@ func NewCfIndex(db database.DB, chainParams *chaincfg.Params) *CfIndex {
|
||||
}
|
||||
|
||||
// DropCfIndex drops the CF index from the provided database if exists.
|
||||
func DropCfIndex(db database.DB) error {
|
||||
return dropIndex(db, cfIndexParentBucketKey, cfIndexName)
|
||||
func DropCfIndex(db database.DB, interrupt <-chan struct{}) error {
|
||||
return dropIndex(db, cfIndexParentBucketKey, cfIndexName, interrupt)
|
||||
}
|
||||
|
2
btcd.go
2
btcd.go
@ -136,7 +136,7 @@ func btcdMain(serverChan chan<- *server) error {
|
||||
return nil
|
||||
}
|
||||
if cfg.DropCfIndex {
|
||||
if err := indexers.DropCfIndex(db); err != nil {
|
||||
if err := indexers.DropCfIndex(db, interrupt); err != nil {
|
||||
btcdLog.Errorf("%v", err)
|
||||
return err
|
||||
}
|
||||
|
@ -5,13 +5,13 @@
|
||||
package netsync
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btcd/blockchain"
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/mempool"
|
||||
"github.com/btcsuite/btcd/peer"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/roasbeef/btcd/blockchain"
|
||||
"github.com/roasbeef/btcd/chaincfg"
|
||||
"github.com/roasbeef/btcd/chaincfg/chainhash"
|
||||
"github.com/roasbeef/btcd/mempool"
|
||||
"github.com/roasbeef/btcd/peer"
|
||||
"github.com/roasbeef/btcd/wire"
|
||||
"github.com/roasbeef/btcutil"
|
||||
)
|
||||
|
||||
// PeerNotifier exposes methods to notify peers of status changes to
|
||||
|
@ -7,10 +7,10 @@ package main
|
||||
import (
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/Roasbeef/btcd/netsync"
|
||||
"github.com/roasbeef/btcd/blockchain"
|
||||
"github.com/roasbeef/btcd/chaincfg/chainhash"
|
||||
"github.com/roasbeef/btcd/mempool"
|
||||
"github.com/roasbeef/btcd/netsync"
|
||||
"github.com/roasbeef/btcd/peer"
|
||||
"github.com/roasbeef/btcd/wire"
|
||||
"github.com/roasbeef/btcutil"
|
||||
|
@ -742,7 +742,7 @@ func (sp *serverPeer) OnGetHeaders(_ *peer.Peer, msg *wire.MsgGetHeaders) {
|
||||
// OnGetCFilter is invoked when a peer receives a getcfilter bitcoin message.
|
||||
func (sp *serverPeer) OnGetCFilter(_ *peer.Peer, msg *wire.MsgGetCFilter) {
|
||||
// Ignore getcfilter requests if not in sync.
|
||||
if !sp.server.blockManager.IsCurrent() {
|
||||
if !sp.server.syncManager.IsCurrent() {
|
||||
return
|
||||
}
|
||||
|
||||
@ -764,12 +764,12 @@ func (sp *serverPeer) OnGetCFilter(_ *peer.Peer, msg *wire.MsgGetCFilter) {
|
||||
// OnGetCFHeaders is invoked when a peer receives a getcfheader bitcoin message.
|
||||
func (sp *serverPeer) OnGetCFHeaders(_ *peer.Peer, msg *wire.MsgGetCFHeaders) {
|
||||
// Ignore getcfilterheader requests if not in sync.
|
||||
if !sp.server.blockManager.IsCurrent() {
|
||||
if !sp.server.syncManager.IsCurrent() {
|
||||
return
|
||||
}
|
||||
|
||||
// Attempt to look up the height of the provided stop hash.
|
||||
chain := sp.server.blockManager.chain
|
||||
chain := sp.server.chain
|
||||
endIdx := int32(math.MaxInt32)
|
||||
height, err := chain.BlockHeightByHash(&msg.HashStop)
|
||||
if err == nil {
|
||||
@ -877,7 +877,7 @@ func (sp *serverPeer) OnGetCFHeaders(_ *peer.Peer, msg *wire.MsgGetCFHeaders) {
|
||||
func (sp *serverPeer) OnGetCFTypes(_ *peer.Peer, msg *wire.MsgGetCFTypes) {
|
||||
// Ignore getcftypes requests if cfg.NoCFilters is set or we're not in
|
||||
// sync.
|
||||
if cfg.NoCFilters || !sp.server.blockManager.IsCurrent() {
|
||||
if cfg.NoCFilters || !sp.server.syncManager.IsCurrent() {
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user