Skip to content

Commit

Permalink
Merge pull request #28 from getAlby/fix/receive-spontaneous-payment-l…
Browse files Browse the repository at this point in the history
…ast-update

fix: receiving spontaneous payment not setting correct last_update
  • Loading branch information
rolznz committed Jun 3, 2024
2 parents 615d714 + 7aafdbf commit e57d02f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use core::task::{Poll, Waker};
use std::collections::VecDeque;
use std::ops::Deref;
use std::sync::{Arc, Condvar, Mutex, RwLock};
use std::time::Duration;
use std::time::{self, Duration};

/// An event emitted by [`Node`], which should be handled by the user.
///
Expand Down Expand Up @@ -630,7 +630,10 @@ where
amount_msat: Some(amount_msat),
direction: PaymentDirection::Inbound,
status: PaymentStatus::Succeeded,
last_update: 0,
last_update: time::SystemTime::now()
.duration_since(time::UNIX_EPOCH)
.unwrap_or(time::Duration::ZERO)
.as_secs(),
fee_msat: None,
};

Expand Down

0 comments on commit e57d02f

Please sign in to comment.