core: don't reverify stale headers in addHeader

During networked synchronization we expect there to be a lot of duplicate
headers received and it makes no sense for us reverifying them.
This commit is contained in:
Roman Khimov 2020-03-03 15:34:03 +03:00
parent 3282c6ed41
commit c3e73c5b7d
2 changed files with 15 additions and 2 deletions

View file

@ -30,7 +30,7 @@ func TestAddHeaders(t *testing.T) {
assert.Equal(t, h3.Hash(), bc.CurrentHeaderHash())
// Add them again, they should not be added.
require.Error(t, bc.AddHeaders(h3, h2, h1))
require.NoError(t, bc.AddHeaders(h3, h2, h1))
assert.Equal(t, h3.Index, bc.HeaderHeight())
assert.Equal(t, uint32(0), bc.BlockHeight())