consensus: fixed genesis slot eta

This commit is contained in:
aggstam
2022-12-18 04:25:49 +02:00
parent c8165d5320
commit f70dd6c054
2 changed files with 3 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ lazy_static! {
pub static ref TESTNET_GENESIS_HASH_BYTES: blake3::Hash = blake3::hash(b"darkfi_testnet");
/// Genesis timestamp for the testnet chain
pub static ref TESTNET_GENESIS_TIMESTAMP: Timestamp = Timestamp(1671329520);
pub static ref TESTNET_GENESIS_TIMESTAMP: Timestamp = Timestamp(1671330180);
// Commonly used Float10
pub static ref FLOAT10_ZERO: Float10 = Float10::from_str_native("0").unwrap().with_precision(RADIX_BITS).value();

View File

@@ -93,7 +93,7 @@ impl ConsensusState {
offset: None,
forks: vec![],
epoch: 0,
epoch_eta: pallas::Base::one(),
epoch_eta: pallas::Base::zero(),
slot_checkpoints: vec![],
leaders_history: vec![0],
coins: vec![],
@@ -191,9 +191,9 @@ impl ConsensusState {
pub async fn init_coins(&mut self) -> Result<()> {
self.epoch = self.current_epoch();
if self.slot_checkpoints.is_empty() {
self.epoch_eta = self.get_eta();
// Create slot checkpoint if not on genesis slot (already in db)
if self.current_slot() != 0 {
self.epoch_eta = self.get_eta();
let (sigma1, sigma2) = self.sigmas();
self.generate_slot_checkpoint(sigma1, sigma2);
}