Updating hpfs log index on ledger creation (#274)

This commit is contained in:
Chalith Desaman
2021-03-24 16:49:38 +05:30
committed by GitHub
parent 31344fe266
commit 44fa3134ea
4 changed files with 29 additions and 0 deletions

View File

@@ -159,6 +159,13 @@ namespace ledger
// Update the last shard hash and shard seqence number tracker when a new ledger is created.
ctx.set_last_primary_shard_id(p2p::sequence_hash{primary_shard_seq_no, last_primary_shard_hash});
// Update the hpfs log index file only in full history mode.
if (conf::cfg.node.history == conf::HISTORY::FULL && sc::contract_fs.update_hpfs_log_index() == -1)
{
LOG_ERROR << errno << ": Error updating the log index file.";
return -1;
}
//Remove old shards that exceeds max shard range.
if (conf::cfg.node.history == conf::HISTORY::CUSTOM && primary_shard_seq_no >= conf::cfg.node.history_config.max_primary_shards)
{