mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Tidy, ensure head tracker is loaded from disk
This commit is contained in:
@@ -361,6 +361,7 @@ fn deposit_validator(
|
|||||||
|
|
||||||
let log_1 = log.clone();
|
let log_1 = log.clone();
|
||||||
let log_2 = log.clone();
|
let log_2 = log.clone();
|
||||||
|
|
||||||
web3.eth()
|
web3.eth()
|
||||||
.accounts()
|
.accounts()
|
||||||
.map_err(|e| format!("Failed to get accounts: {:?}", e))
|
.map_err(|e| format!("Failed to get accounts: {:?}", e))
|
||||||
@@ -385,7 +386,8 @@ fn deposit_validator(
|
|||||||
.then(move |result| match result {
|
.then(move |result| match result {
|
||||||
Ok(true) => Ok(from_address),
|
Ok(true) => Ok(from_address),
|
||||||
Ok(false) => {
|
Ok(false) => {
|
||||||
Err("Eth1 node refused to unlock account".to_string())
|
Err("Eth1 node refused to unlock account. Check password."
|
||||||
|
.to_string())
|
||||||
}
|
}
|
||||||
Err(e) => Err(format!("Eth1 unlock request failed: {:?}", e)),
|
Err(e) => Err(format!("Eth1 unlock request failed: {:?}", e)),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use eth1::Config as Eth1Config;
|
|||||||
use lmd_ghost::{LmdGhost, ThreadSafeReducedTree};
|
use lmd_ghost::{LmdGhost, ThreadSafeReducedTree};
|
||||||
use operation_pool::OperationPool;
|
use operation_pool::OperationPool;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use slog::{error, info, Logger};
|
use slog::{info, Logger};
|
||||||
use slot_clock::{SlotClock, TestingSlotClock};
|
use slot_clock::{SlotClock, TestingSlotClock};
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
@@ -219,9 +219,10 @@ where
|
|||||||
|
|
||||||
self.finalized_checkpoint = Some(p.finalized_checkpoint.clone());
|
self.finalized_checkpoint = Some(p.finalized_checkpoint.clone());
|
||||||
self.genesis_block_root = Some(p.genesis_block_root);
|
self.genesis_block_root = Some(p.genesis_block_root);
|
||||||
self.head_tracker = HeadTracker::from_ssz_container(&p.ssz_head_tracker)
|
self.head_tracker = Some(
|
||||||
.map_err(|e| error!(log, "Failed to decode head tracker for database: {:?}", e))
|
HeadTracker::from_ssz_container(&p.ssz_head_tracker)
|
||||||
.ok();
|
.map_err(|e| format!("Failed to decode head tracker for database: {:?}", e))?,
|
||||||
|
);
|
||||||
self.persisted_beacon_chain = Some(p);
|
self.persisted_beacon_chain = Some(p);
|
||||||
|
|
||||||
Ok(self)
|
Ok(self)
|
||||||
|
|||||||
Reference in New Issue
Block a user