ensure genesis validator set in DB

This commit is contained in:
Robert Habermeier
2017-04-19 15:35:12 +02:00
parent a278dd5a0a
commit af868a7439
3 changed files with 65 additions and 51 deletions

View File

@@ -810,9 +810,11 @@ impl BlockChain {
}
};
transitions.candidates.push(transition);
batch.write(db::COL_EXTRA, &epoch_num, &transitions);
// ensure we don't write any duplicates.
if transitions.candidates.iter().find(|c| c.block_hash == transition.block_hash).is_none() {
transitions.candidates.push(transition);
batch.write(db::COL_EXTRA, &epoch_num, &transitions);
}
}
/// Add a child to a given block. Assumes that the block hash is in