Skip to content

Commit da30a4f

Browse files
authored
Merge pull request #105 from Syn-McJ/fix/coinjoin-coderabbit-fixes
fix(coinjoin): coderabbit review
2 parents aef60be + 33546f1 commit da30a4f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

dash-spv-coinjoin/src/coinjoin_client_manager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ impl CoinJoinClientManager {
221221
// (DashJ) we may not need this
222222
if !dry_run && self.is_waiting_for_new_block() {
223223
let current_time = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs();
224-
225-
if current_time - self.last_time_report_too_recent > 15_000 {
224+
225+
if current_time - self.last_time_report_too_recent > 15 {
226226
self.str_auto_denom_result = "Last successful action was too recent.".to_string();
227227
log_info!(target: "CoinJoin", "do_automatic_denominating {}", self.str_auto_denom_result);
228228
self.last_time_report_too_recent = current_time;

dash-spv-coinjoin/src/masternode_meta_data_manager.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,17 @@ impl MasternodeMetadataManager {
4141
}
4242

4343
pub fn allow_mixing(&mut self, pro_tx_hash: UInt256) {
44-
if let Some(mut mm) = self.get_meta_info(pro_tx_hash, true) {
44+
if let Some(mm) = self.meta_infos.get_mut(&pro_tx_hash) {
4545
self.dsq_count += 1;
4646
mm.last_dsq = self.dsq_count;
4747
mm.mixing_tx_count = 0;
48+
return;
4849
}
50+
51+
let mut info = MasternodeMetaInfo::new(pro_tx_hash);
52+
self.dsq_count += 1;
53+
info.last_dsq = self.dsq_count;
54+
info.mixing_tx_count = 0;
55+
self.meta_infos.insert(pro_tx_hash, info);
4956
}
5057
}

0 commit comments

Comments
 (0)