Skip to content

Commit

Permalink
Add a TODO comment in the genesis ledger loading code mentioning that…
Browse files Browse the repository at this point in the history
… the hash validation is mostly a no-op right now
  • Loading branch information
tizoc committed Mar 28, 2024
1 parent 853ab4c commit e689423
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -110,6 +110,10 @@ impl GenesisConfig {
let (mut mask, total_currency) =
Self::build_ledger_from_accounts_and_hashes(accounts, hashes);
let ledger_hash = ledger_hash(&mut mask);

// TODO(tizoc): currently this doesn't really do much, because now we load the hashes
// from the bin_prot data too to speed up the loading. Maybe add some flag
// to force the rehashing and validation of the loaded ledger hashes.
if let Some(expected_hash) = expected_hash.filter(|h| h != &ledger_hash) {
anyhow::bail!("ledger hash mismatch after building the mask! expected: '{expected_hash}', got '{ledger_hash}'");
}
Expand Down

0 comments on commit e689423

Please sign in to comment.