[1.1.0] LMDB Naming consistency fix (#2656)

* allow separate db name in store creation

* rustfmt

* fixes to db paths to ensure consistency with 1.0.x
This commit is contained in:
Yeastplume
2019-03-06 17:34:39 +00:00
committed by GitHub
parent 6fa137a4ff
commit fd077a489d
5 changed files with 19 additions and 9 deletions
+2 -1
View File
@@ -22,6 +22,7 @@ use crate::core::ser::{self, Readable, Reader, Writeable, Writer};
use crate::types::{Capabilities, PeerAddr, ReasonForBan};
use grin_store::{self, option_to_not_found, to_key, Error};
const DB_NAME: &'static str = "peer";
const STORE_SUBPATH: &'static str = "peers";
const PEER_PREFIX: u8 = 'P' as u8;
@@ -115,7 +116,7 @@ pub struct PeerStore {
impl PeerStore {
/// Instantiates a new peer store under the provided root path.
pub fn new(db_root: &str) -> Result<PeerStore, Error> {
let db = grin_store::Store::new(db_root, Some(STORE_SUBPATH), None)?;
let db = grin_store::Store::new(db_root, Some(DB_NAME), Some(STORE_SUBPATH), None)?;
Ok(PeerStore { db: db })
}