blockchain: server runs goroutine instead of blockchain init

rework initBlockChain in order to have controllable way of running
blockchain;
remove context from initBlockChain func;
This commit is contained in:
Vsevolod Brekelov 2019-09-17 15:27:40 +03:00
parent 39a024eb03
commit adc880d323
4 changed files with 9 additions and 9 deletions

View file

@ -2,7 +2,6 @@ package rpc
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"net/http"
@ -248,7 +247,7 @@ func TestHandler(t *testing.T) {
store, err := storage.NewLevelDBStore(cfg.ApplicationConfiguration.DBConfiguration.LevelDBOptions)
assert.Nil(t, err)
chain, err := core.NewBlockchain(context.Background(), store, cfg.ProtocolConfiguration)
chain, err := core.NewBlockchain(store, cfg.ProtocolConfiguration)
require.NoError(t, err, "could not create levelDB chain")
serverConfig := network.NewServerConfig(cfg)