Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

fix issue #5598 misleading output on import #5878

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ bin/

# Visual Studio Code
browse.VC.db
.vscode

doc/html
*.autosave
Expand Down
8 changes: 6 additions & 2 deletions aleth/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ int main(int argc, char** argv)
double last = 0;
unsigned lastImported = 0;
unsigned imported = 0;
unsigned moreImported = 0;
while (in.peek() != -1)
{
bytes block(8);
Expand Down Expand Up @@ -847,10 +848,13 @@ int main(int argc, char** argv)
while (moreToImport)
{
this_thread::sleep_for(chrono::seconds(1));
tie(ignore, moreToImport, ignore) = web3.ethereum()->syncQueue(100000);
tuple<ImportRoute, bool, unsigned> r = web3.ethereum()->syncQueue(100000);
moreToImport = get<1>(r);
moreImported += get<2>(r);
}
double e = chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - t).count() / 1000.0;
cout << imported << " imported in " << e << " seconds at " << (round(imported * 10 / e) / 10) << " blocks/s (#" << web3.ethereum()->number() << ")\n";
unsigned totalImported = imported + moreImported;
cout << totalImported << " imported in " << e << " seconds at " << (round(totalImported * 10 / e) / 10) << " blocks/s (#" << web3.ethereum()->number() << ")\n";
return AlethErrors::Success;
}

Expand Down