aboutsummaryrefslogtreecommitdiffstats
path: root/dex/handler.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-12-11 18:47:49 +0800
committerWei-Ning Huang <w@dexon.org>2018-12-19 20:54:27 +0800
commit4c31b498bcc0db8926ad2610afa4533fc20ef737 (patch)
tree7bd33b286cc47841e87c6129f63561e50e332ff1 /dex/handler.go
parent4149d8a61a63c6df8e9ce6799203c369aa840c90 (diff)
downloaddexon-4c31b498bcc0db8926ad2610afa4533fc20ef737.tar
dexon-4c31b498bcc0db8926ad2610afa4533fc20ef737.tar.gz
dexon-4c31b498bcc0db8926ad2610afa4533fc20ef737.tar.bz2
dexon-4c31b498bcc0db8926ad2610afa4533fc20ef737.tar.lz
dexon-4c31b498bcc0db8926ad2610afa4533fc20ef737.tar.xz
dexon-4c31b498bcc0db8926ad2610afa4533fc20ef737.tar.zst
dexon-4c31b498bcc0db8926ad2610afa4533fc20ef737.zip
dex: Pull blocks from blockdb if cache miss (#84)
Diffstat (limited to 'dex/handler.go')
-rw-r--r--dex/handler.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/dex/handler.go b/dex/handler.go
index 00f2b5040..2cbbe94d3 100644
--- a/dex/handler.go
+++ b/dex/handler.go
@@ -53,6 +53,7 @@ import (
"github.com/dexon-foundation/dexon/core"
"github.com/dexon-foundation/dexon/core/types"
"github.com/dexon-foundation/dexon/crypto"
+ "github.com/dexon-foundation/dexon/dex/blockdb"
"github.com/dexon-foundation/dexon/dex/downloader"
"github.com/dexon-foundation/dexon/dex/fetcher"
"github.com/dexon-foundation/dexon/ethdb"
@@ -157,7 +158,7 @@ func NewProtocolManager(
nodeTable: tab,
gov: gov,
blockchain: blockchain,
- cache: newCache(128),
+ cache: newCache(5120, blockdb.NewDatabase(chaindb)),
chainconfig: config,
newPeerCh: make(chan *peer),
noMorePeers: make(chan struct{}),