From b92aa8f1590c3ecb1e2fe8ba12a5092ca190786c Mon Sep 17 00:00:00 2001 From: Sonic Date: Thu, 3 Jan 2019 17:18:50 +0800 Subject: core, indexer, dex: fix DexconApp block deliver after synced (#122) When starts a bp node to sync with the network, bc.chainLastHeight map may not be initialized yet. Just return error if we can not get chain last height when preparing payload and verify block. --- indexer/blockchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indexer') diff --git a/indexer/blockchain.go b/indexer/blockchain.go index 421535184..f41c05a15 100644 --- a/indexer/blockchain.go +++ b/indexer/blockchain.go @@ -42,7 +42,7 @@ type ReadOnlyBlockChain interface { GetBlocksFromHash(common.Hash, int) (blocks []*types.Block) GetBody(common.Hash) *types.Body GetBodyRLP(common.Hash) rlp.RawValue - GetChainLastConfirmedHeight(uint32) uint64 + GetChainLastConfirmedHeight(uint32) (uint64, bool) GetConfirmedBlockByHash(uint32, coreCommon.Hash) (*coreTypes.Block, types.Transactions) GetCostInConfirmedBlocks(uint32, common.Address) (*big.Int, bool) GetGovStateByHash(common.Hash) (*types.GovState, error) -- cgit v1.2.3