Skip to content

Commit 48965a9

Browse files
committed
Rename PendingPaymentDetails to RecentPaymentDetails
1 parent 7efad83 commit 48965a9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,9 +1206,9 @@ impl ChannelDetails {
12061206

12071207
/// Used to express the status of payments that are currently pending resolution.
12081208
#[derive(Debug, PartialEq)]
1209-
pub enum PendingPaymentDetails {
1209+
pub enum RecentPaymentDetails {
12101210
/// When a payment is still being sent and awaiting successful delivery.
1211-
Retryable {
1211+
Pending {
12121212
/// Hash of the payment that is currently being sent but has yet to be fulfilled or
12131213
/// abandoned.
12141214
payment_hash: PaymentHash,
@@ -1801,20 +1801,20 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
18011801
}
18021802

18031803
/// Gets a list of payments in ramdom order that are currently pending resolution.
1804-
pub fn list_pending_payments(&self) -> Vec<PendingPaymentDetails> {
1804+
pub fn list_pending_payments(&self) -> Vec<RecentPaymentDetails> {
18051805
self.pending_outbound_payments.lock().unwrap().iter()
18061806
.filter_map(|(_, pending_outbound_payment)| match pending_outbound_payment {
18071807
PendingOutboundPayment::Retryable { payment_hash, total_msat, .. } => {
1808-
Some(PendingPaymentDetails::Retryable {
1808+
Some(RecentPaymentDetails::Pending {
18091809
payment_hash: *payment_hash,
18101810
total_msat: *total_msat,
18111811
})
18121812
},
18131813
PendingOutboundPayment::Abandoned { payment_hash, .. } => {
1814-
Some(PendingPaymentDetails::Abandoned { payment_hash: *payment_hash })
1814+
Some(RecentPaymentDetails::Abandoned { payment_hash: *payment_hash })
18151815
},
18161816
PendingOutboundPayment::Fulfilled { payment_hash, .. } => {
1817-
Some(PendingPaymentDetails::Fulfilled { payment_hash: *payment_hash })
1817+
Some(RecentPaymentDetails::Fulfilled { payment_hash: *payment_hash })
18181818
},
18191819
PendingOutboundPayment::Legacy { .. } => None
18201820
})

lightning/src/ln/payment_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::chain::channelmonitor::{ANTI_REORG_DELAY, LATENCY_GRACE_PERIOD_BLOCKS
1616
use crate::chain::transaction::OutPoint;
1717
use crate::chain::keysinterface::KeysInterface;
1818
use crate::ln::channel::EXPIRE_PREV_CONFIG_TICKS;
19-
use crate::ln::channelmanager::{self, BREAKDOWN_TIMEOUT, ChannelManager, MPP_TIMEOUT_TICKS, MIN_CLTV_EXPIRY_DELTA, PaymentId, PaymentSendFailure, IDEMPOTENCY_TIMEOUT_TICKS, PendingPaymentDetails};
19+
use crate::ln::channelmanager::{self, BREAKDOWN_TIMEOUT, ChannelManager, MPP_TIMEOUT_TICKS, MIN_CLTV_EXPIRY_DELTA, PaymentId, PaymentSendFailure, IDEMPOTENCY_TIMEOUT_TICKS, RecentPaymentDetails};
2020
use crate::ln::msgs;
2121
use crate::ln::msgs::ChannelMessageHandler;
2222
use crate::routing::router::{PaymentParameters, get_route};
@@ -1282,7 +1282,7 @@ fn test_trivial_inflight_htlc_tracking(){
12821282

12831283
let pending_payments = nodes[0].node.list_pending_payments();
12841284
assert_eq!(pending_payments.len(), 1);
1285-
assert_eq!(pending_payments[0], PendingPaymentDetails::Fulfilled);
1285+
assert_eq!(pending_payments[0], RecentPaymentDetails::Fulfilled);
12861286
}
12871287

12881288
// Remove fulfilled payment
@@ -1317,7 +1317,7 @@ fn test_trivial_inflight_htlc_tracking(){
13171317

13181318
let pending_payments = nodes[0].node.list_pending_payments();
13191319
assert_eq!(pending_payments.len(), 1);
1320-
assert_eq!(pending_payments[0], PendingPaymentDetails::Retryable { total_msat: 500000 });
1320+
assert_eq!(pending_payments[0], RecentPaymentDetails::Retryable { total_msat: 500000 });
13211321
}
13221322

13231323
// Now, let's claim the payment. This should result in the used liquidity to return `None`.

0 commit comments

Comments
 (0)