diff options
author | Sonic <sonic@dexon.org> | 2019-01-03 17:18:50 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-01-14 15:26:26 +0800 |
commit | dc18d1eabfc90dfbb6aef3ae999c05238461ccf3 (patch) | |
tree | d372e82440cc01ddf8c0c60e2c7104c0cca36446 /indexer | |
parent | e6442ffcabb4c5cb2f7bc97f9dff7c95ef1527c3 (diff) | |
download | dexon-dc18d1eabfc90dfbb6aef3ae999c05238461ccf3.tar.gz dexon-dc18d1eabfc90dfbb6aef3ae999c05238461ccf3.tar.zst dexon-dc18d1eabfc90dfbb6aef3ae999c05238461ccf3.zip |
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.
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/blockchain.go | 2 |
1 files changed, 1 insertions, 1 deletions
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) |