mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 07:17:40 +01:00
Rename variables referring to PaymentClaimable
This commit is contained in:
parent
f4ab077a69
commit
e09ca27c71
2 changed files with 9 additions and 9 deletions
|
@ -3476,7 +3476,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
|
|||
|
||||
macro_rules! check_total_value {
|
||||
($payment_data: expr, $payment_preimage: expr) => {{
|
||||
let mut payment_received_generated = false;
|
||||
let mut payment_claimable_generated = false;
|
||||
let purpose = || {
|
||||
events::PaymentPurpose::InvoicePayment {
|
||||
payment_preimage: $payment_preimage,
|
||||
|
@ -3523,14 +3523,14 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
|
|||
via_channel_id: Some(prev_channel_id),
|
||||
via_user_channel_id: Some(prev_user_channel_id),
|
||||
});
|
||||
payment_received_generated = true;
|
||||
payment_claimable_generated = true;
|
||||
} else {
|
||||
// Nothing to do - we haven't reached the total
|
||||
// payment value yet, wait until we receive more
|
||||
// MPP parts.
|
||||
htlcs.push(claimable_htlc);
|
||||
}
|
||||
payment_received_generated
|
||||
payment_claimable_generated
|
||||
}}
|
||||
}
|
||||
|
||||
|
@ -3593,8 +3593,8 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
|
|||
log_bytes!(payment_hash.0), payment_data.total_msat, inbound_payment.get().min_value_msat.unwrap());
|
||||
fail_htlc!(claimable_htlc, payment_hash);
|
||||
} else {
|
||||
let payment_received_generated = check_total_value!(payment_data, inbound_payment.get().payment_preimage);
|
||||
if payment_received_generated {
|
||||
let payment_claimable_generated = check_total_value!(payment_data, inbound_payment.get().payment_preimage);
|
||||
if payment_claimable_generated {
|
||||
inbound_payment.remove_entry();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1756,7 +1756,7 @@ pub fn send_along_route_with_secret<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>,
|
|||
payment_id
|
||||
}
|
||||
|
||||
pub fn do_pass_along_path<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_path: &[&Node<'a, 'b, 'c>], recv_value: u64, our_payment_hash: PaymentHash, our_payment_secret: Option<PaymentSecret>, ev: MessageSendEvent, payment_received_expected: bool, clear_recipient_events: bool, expected_preimage: Option<PaymentPreimage>) {
|
||||
pub fn do_pass_along_path<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_path: &[&Node<'a, 'b, 'c>], recv_value: u64, our_payment_hash: PaymentHash, our_payment_secret: Option<PaymentSecret>, ev: MessageSendEvent, payment_claimable_expected: bool, clear_recipient_events: bool, expected_preimage: Option<PaymentPreimage>) {
|
||||
let mut payment_event = SendEvent::from_event(ev);
|
||||
let mut prev_node = origin_node;
|
||||
|
||||
|
@ -1771,7 +1771,7 @@ pub fn do_pass_along_path<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_p
|
|||
|
||||
if idx == expected_path.len() - 1 && clear_recipient_events {
|
||||
let events_2 = node.node.get_and_clear_pending_events();
|
||||
if payment_received_expected {
|
||||
if payment_claimable_expected {
|
||||
assert_eq!(events_2.len(), 1);
|
||||
match events_2[0] {
|
||||
Event::PaymentClaimable { ref payment_hash, ref purpose, amount_msat, receiver_node_id, ref via_channel_id, ref via_user_channel_id } => {
|
||||
|
@ -1808,8 +1808,8 @@ pub fn do_pass_along_path<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_p
|
|||
}
|
||||
}
|
||||
|
||||
pub fn pass_along_path<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_path: &[&Node<'a, 'b, 'c>], recv_value: u64, our_payment_hash: PaymentHash, our_payment_secret: Option<PaymentSecret>, ev: MessageSendEvent, payment_received_expected: bool, expected_preimage: Option<PaymentPreimage>) {
|
||||
do_pass_along_path(origin_node, expected_path, recv_value, our_payment_hash, our_payment_secret, ev, payment_received_expected, true, expected_preimage);
|
||||
pub fn pass_along_path<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_path: &[&Node<'a, 'b, 'c>], recv_value: u64, our_payment_hash: PaymentHash, our_payment_secret: Option<PaymentSecret>, ev: MessageSendEvent, payment_claimable_expected: bool, expected_preimage: Option<PaymentPreimage>) {
|
||||
do_pass_along_path(origin_node, expected_path, recv_value, our_payment_hash, our_payment_secret, ev, payment_claimable_expected, true, expected_preimage);
|
||||
}
|
||||
|
||||
pub fn pass_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_route: &[&[&Node<'a, 'b, 'c>]], recv_value: u64, our_payment_hash: PaymentHash, our_payment_secret: PaymentSecret) {
|
||||
|
|
Loading…
Add table
Reference in a new issue