mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
clean up
This commit is contained in:
@@ -381,7 +381,7 @@ pub struct State {
|
||||
impl ProgramState for State {
|
||||
fn is_valid_cashier_public_key(&self, public: &jubjub::SubgroupPoint) -> bool {
|
||||
debug!(target: "CLIENT STATE", "Check if it is valid cashier public key");
|
||||
return self.public_keys.contains(public);
|
||||
self.public_keys.contains(public)
|
||||
}
|
||||
|
||||
fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {
|
||||
|
||||
@@ -103,7 +103,7 @@ async fn serve(
|
||||
},
|
||||
Err(e) => {
|
||||
debug!(target: "RPC SERVER", "Failed to establish TLS connection: {:#}", e);
|
||||
return Ok(());
|
||||
Ok(())
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ impl BtcClient {
|
||||
input: inputs,
|
||||
output: vec![TxOut {
|
||||
script_pubkey: main_script_pubkey,
|
||||
value: value,
|
||||
value,
|
||||
}],
|
||||
lock_time: 0,
|
||||
version: 2,
|
||||
|
||||
@@ -219,8 +219,9 @@ impl SolClient {
|
||||
));
|
||||
}
|
||||
|
||||
let amnt = cur_balance - prev_balance;
|
||||
|
||||
if mint.is_some() {
|
||||
let amnt = cur_balance - prev_balance;
|
||||
let ui_amnt = amnt / u64::pow(10, decimals as u32);
|
||||
|
||||
send_notification
|
||||
@@ -237,7 +238,6 @@ impl SolClient {
|
||||
debug!(target: "SOL BRIDGE", "Received {} {:?} tokens", ui_amnt, mint.unwrap());
|
||||
let _ = self.send_tok_to_main_wallet(&rpc, &mint.unwrap(), amnt, decimals, &keypair)?;
|
||||
} else {
|
||||
let amnt = cur_balance - prev_balance;
|
||||
let ui_amnt = lamports_to_sol(amnt);
|
||||
|
||||
send_notification
|
||||
|
||||
@@ -63,7 +63,7 @@ impl CashierDb {
|
||||
let conn = Connection::open(&self.path)?;
|
||||
debug!(target: "CASHIERDB", "Opened connection at path {:?}", self.path);
|
||||
conn.pragma_update(None, "key", &self.password)?;
|
||||
conn.execute_batch(&contents)?;
|
||||
conn.execute_batch(contents)?;
|
||||
*self.initialized.lock().await = true;
|
||||
} else {
|
||||
debug!(
|
||||
@@ -264,7 +264,7 @@ impl CashierDb {
|
||||
WHERE d_key_public = :d_key_public AND confirm = :confirm;",
|
||||
)?;
|
||||
let addr_iter = stmt.query_map(
|
||||
&[(":d_key_public", &d_key_public), (":confirm", &&confirm)],
|
||||
&[(":d_key_public", &d_key_public), (":confirm", &confirm)],
|
||||
|row| Ok((row.get(0)?, row.get(1)?, row.get(2)?, row.get(3)?)),
|
||||
)?;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ pub trait WalletApi {
|
||||
}
|
||||
|
||||
fn get_value_deserialized<D: Decodable>(&self, key: &Vec<u8>) -> Result<D> {
|
||||
let v: D = deserialize(&key)?;
|
||||
let v: D = deserialize(key)?;
|
||||
Ok(v)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ impl WalletDb {
|
||||
let conn = Connection::open(&self.path)?;
|
||||
debug!(target: "WALLETDB", "OPENED CONNECTION AT PATH {:?}", self.path);
|
||||
conn.pragma_update(None, "key", &self.password)?;
|
||||
conn.execute_batch(&contents)?;
|
||||
conn.execute_batch(contents)?;
|
||||
*self.initialized.lock().await = true;
|
||||
} else {
|
||||
debug!(
|
||||
|
||||
Reference in New Issue
Block a user