mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 21:03:28 +01:00
blockchain_import: do not error out on truncated files
This will happen often when downloading from a live file
This commit is contained in:
parent
72b5f37f58
commit
e167c4d9a1
@ -326,9 +326,19 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path
|
|||||||
}
|
}
|
||||||
import_file.read(buffer_block, chunk_size);
|
import_file.read(buffer_block, chunk_size);
|
||||||
if (! import_file) {
|
if (! import_file) {
|
||||||
MFATAL("ERROR: unexpected end of file: bytes read before error: "
|
if (import_file.eof())
|
||||||
<< import_file.gcount() << " of chunk_size " << chunk_size);
|
{
|
||||||
return 2;
|
std::cout << refresh_string;
|
||||||
|
MINFO("End of file reached - file was truncated");
|
||||||
|
quit = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MFATAL("ERROR: unexpected end of file: bytes read before error: "
|
||||||
|
<< import_file.gcount() << " of chunk_size " << chunk_size);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bytes_read += chunk_size;
|
bytes_read += chunk_size;
|
||||||
MDEBUG("Total bytes read: " << bytes_read);
|
MDEBUG("Total bytes read: " << bytes_read);
|
||||||
|
Loading…
Reference in New Issue
Block a user