Blockchain graceful shutdown (#139)
* Blockchain graceful shutdown - fix #138 - stop blockchain goroutine - close leveldb database * fix possible context leak (go vet)
This commit is contained in:
parent
c0a5c100ca
commit
9c24bf9139
5 changed files with 53 additions and 19 deletions
|
@ -2,6 +2,7 @@ package rpc
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
@ -25,7 +26,7 @@ func TestHandler(t *testing.T) {
|
|||
t.Fatal("could not create levelDB chain", err)
|
||||
}
|
||||
|
||||
chain, err := core.NewBlockchainLevelDB(cfg)
|
||||
chain, err := core.NewBlockchainLevelDB(context.Background(), cfg)
|
||||
if err != nil {
|
||||
t.Fatal("could not create levelDB chain", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue