From 7aafdbf6aeeb762e723f0bb47f8f96d55882d14e Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Mon, 3 Jun 2024 14:04:03 +0700 Subject: [PATCH] fix: receiving spontaneous payment not setting correct last_update --- src/event.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/event.rs b/src/event.rs index af9612591..7894af6c4 100644 --- a/src/event.rs +++ b/src/event.rs @@ -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. /// @@ -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, };