Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocks

This commit is contained in:
moneromooo-monero
2017-08-29 15:43:32 +01:00
parent 84fa015e77
commit ce901fcb31
5 changed files with 47 additions and 15 deletions

View File

@@ -208,7 +208,8 @@ int check_flush(cryptonote::core &core, std::list<block_complete_entry> &blocks,
}
} // each download block
core.cleanup_handle_incoming_blocks();
if (!core.cleanup_handle_incoming_blocks())
return 1;
blocks.clear();
return 0;
@@ -394,7 +395,10 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path
blocks.push_back({block, txs});
int ret = check_flush(core, blocks, false);
if (ret)
{
quit = 2; // make sure we don't commit partial block data
break;
}
}
else
{