mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
reimplemented cashier public check after overwritten by conflict
This commit is contained in:
@@ -52,7 +52,18 @@ struct MemoryState {
|
||||
impl ProgramState for MemoryState {
|
||||
// Vec<u8> for keys
|
||||
fn is_valid_cashier_public_key(&self, public: &jubjub::SubgroupPoint) -> bool {
|
||||
public == &self.cashier_public
|
||||
let path = dirs::home_dir()
|
||||
.expect("Cannot find home directory.")
|
||||
.as_path()
|
||||
.join(".config/darkfi/cashier.db");
|
||||
let connect = Connection::open(&path).expect("Failed to connect to database.");
|
||||
let mut stmt = connect.prepare("SELECT key_public FROM keys").unwrap();
|
||||
let key_iter = stmt.query_map::<Vec<u8>, _, _>([], |row| row.get(0)).unwrap();
|
||||
// does not actually check whether the cashier key is valid
|
||||
for key in key_iter {
|
||||
key.unwrap() == self.cashier_public;
|
||||
}
|
||||
true
|
||||
}
|
||||
// rocksdb
|
||||
fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user