mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
consensus: fixed genesis slot eta
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user