aboutsummaryrefslogtreecommitdiffstats
path: root/dex/blockproposer.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-04-03 16:43:49 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-15 22:09:55 +0800
commit89aed9c306ea8b1b712bf8e84c1f79b328e19052 (patch)
treee6f80dd9051bcf773ec8dbf0368426aec6b6f6eb /dex/blockproposer.go
parentc597b2ff15aefcc73d55a0a3f8c8e0f6e18f083c (diff)
downloadgo-tangerine-89aed9c306ea8b1b712bf8e84c1f79b328e19052.tar.gz
go-tangerine-89aed9c306ea8b1b712bf8e84c1f79b328e19052.tar.zst
go-tangerine-89aed9c306ea8b1b712bf8e84c1f79b328e19052.zip
vendor: sync to latest core
Diffstat (limited to 'dex/blockproposer.go')
-rw-r--r--dex/blockproposer.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/dex/blockproposer.go b/dex/blockproposer.go
index 0b66a6cc1..8eaeb9761 100644
--- a/dex/blockproposer.go
+++ b/dex/blockproposer.go
@@ -121,10 +121,12 @@ func (b *blockProposer) syncConsensus() (*dexCore.Consensus, error) {
atomic.StoreInt32(&b.syncing, 1)
defer atomic.StoreInt32(&b.syncing, 0)
+ cb := b.dex.blockchain.CurrentBlock()
+
db := db.NewDatabase(b.dex.chainDb)
privkey := coreEcdsa.NewPrivateKeyFromECDSA(b.dex.config.PrivateKey)
- consensusSync := syncer.NewConsensus(b.dMoment, b.dex.app, b.dex.governance,
- db, b.dex.network, privkey, log.Root())
+ consensusSync := syncer.NewConsensus(cb.NumberU64(), b.dMoment, b.dex.app,
+ b.dex.governance, db, b.dex.network, privkey, log.Root())
// Start the watchCat.
b.watchCat.Start()
@@ -132,7 +134,6 @@ func (b *blockProposer) syncConsensus() (*dexCore.Consensus, error) {
log.Info("Started sync watchCat")
// Feed the current block we have in local blockchain.
- cb := b.dex.blockchain.CurrentBlock()
if cb.NumberU64() > 0 {
var block coreTypes.Block
if err := rlp.DecodeBytes(cb.Header().DexconMeta, &block); err != nil {