diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-16 10:45:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 10:45:06 +0800 |
commit | 591c80dbe9dbdea4cec202b07f4da081020f964a (patch) | |
tree | 451cfd667943a11ddbfcd09245161a614481fb5b /core/blockdb | |
parent | 02669f255e0d131c9e5fce49660103a636dddd51 (diff) | |
download | tangerine-consensus-591c80dbe9dbdea4cec202b07f4da081020f964a.tar tangerine-consensus-591c80dbe9dbdea4cec202b07f4da081020f964a.tar.gz tangerine-consensus-591c80dbe9dbdea4cec202b07f4da081020f964a.tar.bz2 tangerine-consensus-591c80dbe9dbdea4cec202b07f4da081020f964a.tar.lz tangerine-consensus-591c80dbe9dbdea4cec202b07f4da081020f964a.tar.xz tangerine-consensus-591c80dbe9dbdea4cec202b07f4da081020f964a.tar.zst tangerine-consensus-591c80dbe9dbdea4cec202b07f4da081020f964a.zip |
core: Fix various syncing issue. (#331)
Diffstat (limited to 'core/blockdb')
-rw-r--r-- | core/blockdb/memory.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/blockdb/memory.go b/core/blockdb/memory.go index 760646e..b45af22 100644 --- a/core/blockdb/memory.go +++ b/core/blockdb/memory.go @@ -124,6 +124,10 @@ func (m *MemBackedBlockDB) Put(block types.Block) error { // Update updates a block in the database. func (m *MemBackedBlockDB) Update(block types.Block) error { + if !m.Has(block.Hash) { + return ErrBlockDoesNotExist + } + m.blocksMutex.Lock() defer m.blocksMutex.Unlock() |