lmdb: fix u64 key
This commit is contained in:
@@ -16,7 +16,7 @@ use std::cell::RefCell;
|
||||
use std::{fs, path};
|
||||
|
||||
// for writing stored transaction files
|
||||
use byteorder::BigEndian;
|
||||
use byteorder::{BigEndian, WriteBytesExt};
|
||||
use std::fs::File;
|
||||
use std::io::{Read, Write};
|
||||
use std::marker::PhantomData;
|
||||
@@ -40,7 +40,6 @@ use crate::util::{self, secp, ToHex};
|
||||
|
||||
use rand::rngs::mock::StepRng;
|
||||
use rand::thread_rng;
|
||||
use tokio::io::AsyncWriteExt;
|
||||
|
||||
pub const DB_DIR: &str = "db";
|
||||
pub const TX_SAVE_DIR: &str = "saved_txs";
|
||||
@@ -775,6 +774,6 @@ where
|
||||
/// Build a db key from a byte vector identifier and numeric identifier
|
||||
fn to_key_u64<K: AsRef<[u8]>>(k: K, val: u64) -> Vec<u8> {
|
||||
let mut res = k.as_ref().to_vec();
|
||||
res.write_u64(val);
|
||||
res.write_u64::<BigEndian>(val).unwrap();
|
||||
res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user