diff --git a/sqlchain/chain.go b/sqlchain/chain.go index 336f61557..369dcb1c1 100644 --- a/sqlchain/chain.go +++ b/sqlchain/chain.go @@ -792,7 +792,7 @@ func (c *Chain) processBlocks(ctx context.Context) { } // Start starts the main process of the sql-chain. -func (c *Chain) Start() (err error) { +func (c *Chain) Start() { c.rt.goFunc(c.processBlocks) c.sync() c.rt.goFunc(c.mainCycle) diff --git a/sqlchain/chain_test.go b/sqlchain/chain_test.go index 34cda8515..0b217efb4 100644 --- a/sqlchain/chain_test.go +++ b/sqlchain/chain_test.go @@ -275,10 +275,7 @@ func TestMultiChain(t *testing.T) { // Start all chain instances for _, v := range chains { - if err = v.chain.Start(); err != nil { - t.Fatalf("error occurred: %v", err) - } - + v.chain.Start() defer func(c *Chain) { // Stop chain main process before exit _ = c.Stop() diff --git a/worker/db.go b/worker/db.go index 69bff12a2..1d5759802 100644 --- a/worker/db.go +++ b/worker/db.go @@ -175,9 +175,8 @@ func NewDatabase(cfg *DBConfig, peers *proto.Peers, } if db.chain, err = sqlchain.NewChain(chainCfg); err != nil { return - } else if err = db.chain.Start(); err != nil { - return } + go db.chain.Start() // init kayak config kayakWalPath := filepath.Join(cfg.DataDir, KayakWalFileName)