aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornecrashter2022-04-23 16:56:25 +0300
committerYigit Sever2022-04-23 18:10:12 +0300
commit72cdcda9eff98c7bd0cc07416c85e2d8c8de6983 (patch)
tree409f3ea9751ca4bde60c4484cb07bfa29fa5bb04 /src
parent92b37178167435027bb9e4db22b5c44977f341f9 (diff)
downloadgradecoin-72cdcda9eff98c7bd0cc07416c85e2d8c8de6983.tar.gz
gradecoin-72cdcda9eff98c7bd0cc07416c85e2d8c8de6983.tar.bz2
gradecoin-72cdcda9eff98c7bd0cc07416c85e2d8c8de6983.zip
Bugfix in parse_block
Diffstat (limited to 'src')
-rw-r--r--src/db.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/db.rs b/src/db.rs
index 2187010..70204a2 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -122,8 +122,9 @@ fn read_block_name(config_name: &str) -> io::Result<Vec<PathBuf>> {
122} 122}
123 123
124fn parse_block(path: &str) -> u64 { 124fn parse_block(path: &str) -> u64 {
125 let start_pos = path.rfind("/").unwrap() + 1;
125 let end_pos = path.find(".block").unwrap(); 126 let end_pos = path.find(".block").unwrap();
126 let block_str = path[9..end_pos].to_string(); 127 let block_str = path[start_pos..end_pos].to_string();
127 let block_u64: u64 = block_str.parse().unwrap(); 128 let block_u64: u64 = block_str.parse().unwrap();
128 block_u64 129 block_u64
129} 130}