Minor compilation errors due to moving store Error.

This commit is contained in:
Ignotus Peverell 2017-02-10 11:02:21 -08:00
parent 786da24653
commit 510feadce6
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211
2 changed files with 6 additions and 4 deletions

View file

@ -22,6 +22,7 @@ use core::core::hash::{Hash, Hashed};
use core::core::target::Difficulty; use core::core::target::Difficulty;
use p2p::{self, NetAdapter, Server}; use p2p::{self, NetAdapter, Server};
use util::OneTime; use util::OneTime;
use store;
use sync; use sync;
/// Implementation of the NetAdapter for the blockchain. Gets notified when new /// Implementation of the NetAdapter for the blockchain. Gets notified when new
@ -122,7 +123,7 @@ impl NetAdapter for NetToChainAdapter {
let known = self.chain_store.get_block_header(&locator[0]); let known = self.chain_store.get_block_header(&locator[0]);
let header = match known { let header = match known {
Ok(header) => header, Ok(header) => header,
Err(chain::types::Error::NotFoundErr) => { Err(store::Error::NotFoundErr) => {
return self.locate_headers(locator[1..].to_vec()); return self.locate_headers(locator[1..].to_vec());
} }
Err(e) => { Err(e) => {
@ -138,7 +139,7 @@ impl NetAdapter for NetToChainAdapter {
let header = self.chain_store.get_header_by_height(h); let header = self.chain_store.get_header_by_height(h);
match header { match header {
Ok(head) => headers.push(head), Ok(head) => headers.push(head),
Err(chain::types::Error::NotFoundErr) => break, Err(store::Error::NotFoundErr) => break,
Err(e) => { Err(e) => {
error!("Could not build header locator: {:?}", e); error!("Could not build header locator: {:?}", e);
return vec![]; return vec![];

View file

@ -29,6 +29,7 @@ use chain::ChainStore;
use core; use core;
use miner; use miner;
use p2p; use p2p;
use store;
use sync; use sync;
/// Errors than can be reported by a server implementation, mostly wraps /// Errors than can be reported by a server implementation, mostly wraps
@ -40,7 +41,7 @@ pub enum Error {
/// Peer connection error /// Peer connection error
PeerErr(core::ser::Error), PeerErr(core::ser::Error),
/// Data store error /// Data store error
StoreErr(chain::types::Error), StoreErr(store::Error),
} }
/// Full server configuration, aggregating configurations required for the /// Full server configuration, aggregating configurations required for the
@ -174,7 +175,7 @@ fn store_head(config: &ServerConfig)
// check if we have a head in store, otherwise the genesis block is it // check if we have a head in store, otherwise the genesis block is it
let head = match chain_store.head() { let head = match chain_store.head() {
Ok(tip) => tip, Ok(tip) => tip,
Err(chain::types::Error::NotFoundErr) => { Err(store::Error::NotFoundErr) => {
debug!("No genesis block found, creating and saving one."); debug!("No genesis block found, creating and saving one.");
let mut gen = core::genesis::genesis(); let mut gen = core::genesis::genesis();
if config.cuckoo_size > 0 { if config.cuckoo_size > 0 {