Commit 9fad87f0 authored by vipwzw's avatar vipwzw Committed by 33cn

fix testnode

parent 44deaf4c
......@@ -83,6 +83,10 @@ func NewWithConfig(cfg *types.Config, sub *types.ConfigSubModule, mockapi client
func newWithConfig(cfg *types.Config, sub *types.ConfigSubModule, mockapi client.QueueProtocolAPI) *Chain33Mock {
chain33globalLock.Lock()
return newWithConfigNoLock(cfg, sub, mockapi)
}
func newWithConfigNoLock(cfg *types.Config, sub *types.ConfigSubModule, mockapi client.QueueProtocolAPI) *Chain33Mock {
types.Init(cfg.Title, cfg)
q := queue.New("channel")
types.Debug = false
......@@ -280,6 +284,11 @@ func (mock *Chain33Mock) GetCfg() *types.Config {
//Close :
func (mock *Chain33Mock) Close() {
mock.closeNoLock()
chain33globalLock.Unlock()
}
func (mock *Chain33Mock) closeNoLock() {
mock.chain.Close()
mock.store.Close()
mock.mem.Close()
......@@ -290,7 +299,6 @@ func (mock *Chain33Mock) Close() {
mock.client.Close()
mock.rpc.Close()
os.RemoveAll(mock.datadir)
chain33globalLock.Unlock()
}
//WaitHeight :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment