From a1769feb16d34d26fdc6f2544803328b416dca89 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 18 Jul 2022 09:48:18 -0700 Subject: [PATCH] dbfs 0.1.8 --- persister/Cargo.toml | 2 +- persister/src/persist_fs.rs | 21 ++++++--------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/persister/Cargo.toml b/persister/Cargo.toml index 27c3f42..e5ecff7 100644 --- a/persister/Cargo.toml +++ b/persister/Cargo.toml @@ -10,4 +10,4 @@ lightning-signer-core = { git = "https://gitlab.com/Evanfeenstra/validating-ligh lightning-signer-server = { git = "https://gitlab.com/Evanfeenstra/validating-lightning-signer", branch = "patch-sign-chan", default-features = false, features = ["persist"] } serde = { version = "1.0.105" } hex = "0.4.3" -fsdb = "0.1.7" \ No newline at end of file +fsdb = "0.1.8" \ No newline at end of file diff --git a/persister/src/persist_fs.rs b/persister/src/persist_fs.rs index 4049175..e7a5a18 100644 --- a/persister/src/persist_fs.rs +++ b/persister/src/persist_fs.rs @@ -32,22 +32,13 @@ pub struct FsPersister { impl FsPersister { pub fn new() -> Self { let db = Fsdb::new("home/ubuntu/sdcard").expect("could not create db"); - let mut nodes = db.bucket("nodes").expect("fail nodes"); - nodes.set_max_file_name(FAT32_MAXFILENAMESIZE); - let mut channels = db.double_bucket("channel").expect("fail channel"); - channels.set_max_file_name(FAT32_MAXFILENAMESIZE); - let mut allowlist = db.bucket("allowlis").expect("fail allowlis"); - allowlist.set_max_file_name(FAT32_MAXFILENAMESIZE); - let mut chaintracker = db.bucket("chaintra").expect("fail chaintra"); - chaintracker.set_max_file_name(FAT32_MAXFILENAMESIZE); - let mut pubkeys = db.bucket("pubkey").expect("fail pubkey"); - pubkeys.set_max_file_name(FAT32_MAXFILENAMESIZE); + let max = Some(FAT32_MAXFILENAMESIZE); Self { - nodes, - channels, - allowlist, - chaintracker, - pubkeys, + nodes: db.bucket("nodes", max).expect("fail nodes"), + channels: db.double_bucket("channel", max).expect("fail channel"), + allowlist: db.bucket("allowlis", max).expect("fail allowlis"), + chaintracker: db.bucket("chaintra", max).expect("fail chaintra"), + pubkeys: db.bucket("pubkey", max).expect("fail pubkey"), } } }