mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 04:57:17 +00:00
Stop blockchain when terminating downloader (#574)
* Print * Stop blockchain on Terminate * Remove prints
This commit is contained in:
parent
df28575420
commit
154b9a9ca2
@ -231,6 +231,9 @@ type BlockChain interface {
|
||||
|
||||
// GetVMConfig is necessary for staged sync
|
||||
GetVMConfig() *vm.Config
|
||||
|
||||
// Stop the import that is going on
|
||||
Stop()
|
||||
}
|
||||
|
||||
// New creates a new downloader to fetch hashes and blocks from remote peers.
|
||||
@ -609,6 +612,7 @@ func (d *Downloader) Cancel() {
|
||||
// Terminate interrupts the downloader, canceling all pending operations.
|
||||
// The downloader cannot be reused after calling Terminate.
|
||||
func (d *Downloader) Terminate() {
|
||||
d.blockchain.Stop()
|
||||
// Close the termination channel (make sure double close is allowed)
|
||||
d.quitLock.Lock()
|
||||
select {
|
||||
|
@ -390,6 +390,9 @@ func (dl *downloadTester) GetHeader(common.Hash, uint64) *types.Header {
|
||||
panic("not implemented and should not be called")
|
||||
}
|
||||
|
||||
func (dl *downloadTester) Stop() {
|
||||
}
|
||||
|
||||
type downloadTesterPeer struct {
|
||||
dl *downloadTester
|
||||
id string
|
||||
|
@ -275,6 +275,9 @@ func (st *stagedSyncTester) sync(id string, td *big.Int) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (st *stagedSyncTester) Stop() {
|
||||
}
|
||||
|
||||
type stagedSyncTesterPeer struct {
|
||||
st *stagedSyncTester
|
||||
id string
|
||||
|
Loading…
Reference in New Issue
Block a user