Skip to content

Commit

Permalink
fix: oms validation (#6161)
Browse files Browse the repository at this point in the history
Description
---
Fixes the OMS validation to invalidate unmined utxos and not keep them
pending

Motivation and Context
---
Although these utxo would never reach spending, the wallet sees them as
pending incoming or pending outgoing. We need to ensure their status is
correctly set.
  • Loading branch information
SWvheerden committed Feb 26, 2024
1 parent 8990b57 commit f3d1219
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -46,6 +46,7 @@ use crate::{
storage::{
database::{OutputManagerBackend, OutputManagerDatabase},
models::DbWalletOutput,
OutputStatus,
},
},
};
Expand Down Expand Up @@ -318,6 +319,20 @@ where
)
.await?;
}
for unmined_output in unmined {
if unmined_output.status == OutputStatus::UnspentMinedUnconfirmed {
info!(
target: LOG_TARGET,
"Updating output comm:{}: hash {} as unmined(Operation ID: {})",
unmined_output.commitment.to_hex(),
unmined_output.hash.to_hex(),
self.operation_id
);
self.db
.set_output_to_unmined_and_invalid(unmined_output.hash)
.for_protocol(self.operation_id)?;
}
}
}

Ok(())
Expand Down

0 comments on commit f3d1219

Please sign in to comment.