Skip to content
Open
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
4 changes: 2 additions & 2 deletions blockchain/indexers/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ var (
// fields for storage in the database.
byteOrder = binary.LittleEndian

// errInterruptRequested indicates that an operation was cancelled due
// ErrInterruptRequested indicates that an operation was cancelled due
// to a user-requested interrupt.
errInterruptRequested = errors.New("interrupt requested")
ErrInterruptRequested = errors.New("interrupt requested")
)

// NeedsInputser provides a generic interface for an indexer to specify the it
Expand Down
12 changes: 6 additions & 6 deletions blockchain/indexers/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (m *Manager) maybeFinishDrops(interrupt <-chan struct{}) error {
}

if interruptRequested(interrupt) {
return errInterruptRequested
return ErrInterruptRequested
}

// Finish dropping any of the enabled indexes that are already in the
Expand Down Expand Up @@ -240,7 +240,7 @@ func (m *Manager) Init(chain *blockchain.BlockChain, interrupt <-chan struct{})
}

if interruptRequested(interrupt) {
return errInterruptRequested
return ErrInterruptRequested
}

// Finish and drops that were previously interrupted.
Expand Down Expand Up @@ -350,7 +350,7 @@ func (m *Manager) Init(chain *blockchain.BlockChain, interrupt <-chan struct{})
}

if interruptRequested(interrupt) {
return errInterruptRequested
return ErrInterruptRequested
}
}

Expand Down Expand Up @@ -411,7 +411,7 @@ func (m *Manager) Init(chain *blockchain.BlockChain, interrupt <-chan struct{})
}

if interruptRequested(interrupt) {
return errInterruptRequested
return ErrInterruptRequested
}

// Connect the block for all indexes that need it.
Expand Down Expand Up @@ -448,7 +448,7 @@ func (m *Manager) Init(chain *blockchain.BlockChain, interrupt <-chan struct{})
progressLogger.LogBlockHeight(block)

if interruptRequested(interrupt) {
return errInterruptRequested
return ErrInterruptRequested
}
}

Expand Down Expand Up @@ -657,7 +657,7 @@ func dropIndex(db database.DB, idxKey []byte, idxName string, interrupt <-chan s
}

if interruptRequested(interrupt) {
return errInterruptRequested
return ErrInterruptRequested
}

// Drop the bucket itself.
Expand Down
6 changes: 6 additions & 0 deletions btcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package main

import (
"errors"
"fmt"
"net"
"net/http"
Expand Down Expand Up @@ -265,6 +266,11 @@ func btcdMain(serverChan chan<- *server) error {
// Create server and start it.
server, err := newServer(cfg.Listeners, cfg.AgentBlacklist,
cfg.AgentWhitelist, db, activeNetParams.Params, interrupt)
if err != nil && errors.Is(err, indexers.ErrInterruptRequested) {
btcdLog.Infof("Unable to start server on %v: %v",
cfg.Listeners, err)
return nil
}
if err != nil {
// TODO: this logging could do with some beautifying.
btcdLog.Errorf("Unable to start server on %v: %v",
Comment thread
allocz marked this conversation as resolved.
Expand Down