Skip to content

Commit

Permalink
fix: make last_update optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Mar 16, 2024
1 parent 779729b commit 5676c2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/payment/payment_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Readable for PaymentDetails {
(6, amount_msat, required),
(8, direction, required),
(10, status, required),
(131074, last_update, required),
(131074, last_update, option),
});

let id: PaymentId = id.0.ok_or(DecodeError::InvalidValue)?;
Expand All @@ -79,7 +79,7 @@ impl Readable for PaymentDetails {
let amount_msat: Option<u64> = amount_msat.0.ok_or(DecodeError::InvalidValue)?;
let direction: PaymentDirection = direction.0.ok_or(DecodeError::InvalidValue)?;
let status: PaymentStatus = status.0.ok_or(DecodeError::InvalidValue)?;
let last_update: u64 = last_update.0.ok_or(DecodeError::InvalidValue)?;
let last_update: u64 = last_update.or(Some(0)).ok_or(DecodeError::InvalidValue)?;

let kind = if let Some(kind) = kind_opt {
// If we serialized the payment kind, use it.
Expand Down

0 comments on commit 5676c2c

Please sign in to comment.