Skip to content

Commit

Permalink
update wallet code
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Jun 10, 2022
1 parent 4f4e5a0 commit a2ea334
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub struct OutputSql {
#[derivative(Debug = "ignore")]
pub spending_key: Vec<u8>,
pub value: i64,
// TODO: Rename this to output_type
pub flags: i32,
pub maturity: i64,
pub recovery_byte: i32,
Expand Down Expand Up @@ -123,8 +124,8 @@ impl OutputSql {
tip_height: i64,
conn: &SqliteConnection,
) -> Result<Vec<OutputSql>, OutputManagerStorageError> {
let no_flags = i32::from(OutputFlags::empty().bits());
let coinbase_flag = i32::from(OutputFlags::COINBASE_OUTPUT.bits());
let no_flags = i32::from(OutputType::Standard.as_byte());
let coinbase_flag = i32::from(OutputType::Coinbase.as_byte());

if strategy == UTXOSelectionStrategy::Default {
// lets get the max value for all utxos
Expand Down Expand Up @@ -511,7 +512,7 @@ impl TryFrom<OutputSql> for DbUnblindedOutput {
.flags
.try_into()
.map_err(|_| OutputManagerStorageError::ConversionError {
reason: format!("Unable to convert flag bits with value {} to OutputFlags", o.flags),
reason: format!("Unable to convert flag bits with value {} to OutputType", o.flags),
})?;
features.output_type = OutputType::from_byte(flags).ok_or(OutputManagerStorageError::ConversionError {
reason: "Flags could not be converted from bits".to_string(),
Expand Down

0 comments on commit a2ea334

Please sign in to comment.