ethereum / aleth

Aleth – Ethereum C++ client, tools and libraries
GNU General Public License v3.0
3.96k stars 2.18k forks source link

fix issue #5598 misleading output on import #5878

Open qblays opened 4 years ago

qblays commented 4 years ago

The line https://github.com/ethereum/aleth/blob/2fe1bec5022e8160da03cf47994a093a1686646f/aleth/main.cpp#L832 always return zero number of synced blocks. It happens because BlockQueue::drain can take m_lock (and it always does) before BlockQueue::verifierBody. So https://github.com/ethereum/aleth/blob/2fe1bec5022e8160da03cf47994a093a1686646f/libethereum/BlockQueue.cpp#L426 tries to extract from empty m_verified queue. The solution is to wait until all unverified blocks gone and then sync

codecov-io commented 4 years ago

Codecov Report

Merging #5878 into master will increase coverage by 0.01%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5878      +/-   ##
==========================================
+ Coverage   63.94%   63.95%   +0.01%     
==========================================
  Files         365      365              
  Lines       31098    31101       +3     
  Branches     3441     3441              
==========================================
+ Hits        19885    19891       +6     
+ Misses       9980     9979       -1     
+ Partials     1233     1231       -2