Bug fixes
This commit is contained in:
parent
5363904a9d
commit
542e2f3fb3
|
@ -823,6 +823,8 @@ impl DbAdapter {
|
||||||
)?;
|
)?;
|
||||||
self.connection
|
self.connection
|
||||||
.execute("DELETE FROM taddrs WHERE account = ?1", params![account])?;
|
.execute("DELETE FROM taddrs WHERE account = ?1", params![account])?;
|
||||||
|
self.connection
|
||||||
|
.execute("DELETE FROM messages WHERE account = ?1", params![account])?;
|
||||||
self.connection.execute(
|
self.connection.execute(
|
||||||
"DELETE FROM secret_shares WHERE account = ?1",
|
"DELETE FROM secret_shares WHERE account = ?1",
|
||||||
params![account],
|
params![account],
|
||||||
|
@ -926,6 +928,12 @@ pub struct ZMessage {
|
||||||
pub height: u32,
|
pub height: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ZMessage {
|
||||||
|
pub fn is_empty(&self) -> bool {
|
||||||
|
self.sender.is_none() && self.subject.is_empty() && self.body.is_empty()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use zcash_params::coin::CoinType;
|
use zcash_params::coin::CoinType;
|
||||||
|
|
|
@ -243,8 +243,10 @@ pub async fn retrieve_tx_info(
|
||||||
}
|
}
|
||||||
db.store_tx_metadata(tx_info.id_tx, &tx_info)?;
|
db.store_tx_metadata(tx_info.id_tx, &tx_info)?;
|
||||||
let z_msg = decode_memo(&tx_info.memo, &tx_info.address, tx_info.timestamp, tx_info.height);
|
let z_msg = decode_memo(&tx_info.memo, &tx_info.address, tx_info.timestamp, tx_info.height);
|
||||||
|
if !z_msg.is_empty() {
|
||||||
db.store_message(tx_info.account, &z_msg)?;
|
db.store_message(tx_info.account, &z_msg)?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
contacts.sort_by(|a, b| a.index.cmp(&b.index));
|
contacts.sort_by(|a, b| a.index.cmp(&b.index));
|
||||||
for cref in contacts.iter() {
|
for cref in contacts.iter() {
|
||||||
db.store_contact(&cref.contact, false)?;
|
db.store_contact(&cref.contact, false)?;
|
||||||
|
|
Loading…
Reference in New Issue