X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Fchanmon_consistency.rs;h=605a8c29c291690cacff642d78454d00950517ee;hb=d9d4611e65c64001d5ac3b46a1c0288965ee4378;hp=a02d003e1b7a88ab2d70bb490d5280a079513f6d;hpb=f961daef33ad1e999c83aafbf654db449e0e93e0;p=rust-lightning diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs index a02d003e..605a8c29 100644 --- a/fuzz/src/chanmon_consistency.rs +++ b/fuzz/src/chanmon_consistency.rs @@ -38,7 +38,7 @@ use lightning::chain::transaction::OutPoint; use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator}; use lightning::chain::keysinterface::{KeyMaterial, KeysInterface, InMemorySigner, Recipient}; use lightning::ln::{PaymentHash, PaymentPreimage, PaymentSecret}; -use lightning::ln::channelmanager::{self, ChainParameters, ChannelManager, PaymentSendFailure, ChannelManagerReadArgs}; +use lightning::ln::channelmanager::{self, ChainParameters, ChannelManager, PaymentSendFailure, ChannelManagerReadArgs, PaymentId}; use lightning::ln::channel::FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE; use lightning::ln::msgs::{CommitmentUpdate, ChannelMessageHandler, DecodeError, UpdateAddHTLC, Init}; use lightning::ln::script::ShutdownScript; @@ -51,8 +51,8 @@ use lightning::util::events::MessageSendEventsProvider; use lightning::util::ser::{Readable, ReadableArgs, Writeable, Writer}; use lightning::routing::router::{Route, RouteHop}; -use utils::test_logger::{self, Output}; -use utils::test_persister::TestPersister; +use crate::utils::test_logger::{self, Output}; +use crate::utils::test_persister::TestPersister; use bitcoin::secp256k1::{PublicKey, SecretKey, Scalar}; use bitcoin::secp256k1::ecdh::SharedSecret; @@ -193,9 +193,14 @@ impl KeysInterface for KeyProvider { ShutdownScript::new_p2wpkh(&pubkey_hash) } - fn get_channel_signer(&self, _inbound: bool, channel_value_satoshis: u64) -> EnforcingSigner { + fn generate_channel_keys_id(&self, _inbound: bool, _channel_value_satoshis: u64, _user_channel_id: u128) -> [u8; 32] { + let id = self.rand_bytes_id.fetch_add(1, atomic::Ordering::Relaxed) as u8; + [id; 32] + } + + fn derive_channel_signer(&self, channel_value_satoshis: u64, channel_keys_id: [u8; 32]) -> Self::Signer { let secp_ctx = Secp256k1::signing_only(); - let id = self.rand_bytes_id.fetch_add(1, atomic::Ordering::Relaxed); + let id = channel_keys_id[0]; let keys = InMemorySigner::new( &secp_ctx, self.get_node_secret(Recipient::Node).unwrap(), @@ -204,9 +209,9 @@ impl KeysInterface for KeyProvider { SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, self.node_id]).unwrap(), SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, self.node_id]).unwrap(), SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, self.node_id]).unwrap(), - [id as u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, self.node_id], + [id, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, self.node_id], channel_value_satoshis, - [0; 32], + channel_keys_id, ); let revoked_commitment = self.make_enforcement_state_cell(keys.commitment_seed); EnforcingSigner::new_with_revoked(keys, revoked_commitment, false) @@ -253,7 +258,7 @@ fn check_api_err(api_err: APIError) { match api_err { APIError::APIMisuseError { .. } => panic!("We can't misuse the API"), APIError::FeeRateTooHigh { .. } => panic!("We can't send too much fee?"), - APIError::RouteError { .. } => panic!("Our routes should work"), + APIError::InvalidRoute { .. } => panic!("Our routes should work"), APIError::ChannelUnavailable { err } => { // Test the error against a list of errors we can hit, and reject // all others. If you hit this panic, the list of acceptable errors @@ -283,16 +288,17 @@ fn check_payment_err(send_err: PaymentSendFailure) { PaymentSendFailure::PathParameterError(per_path_results) => { for res in per_path_results { if let Err(api_err) = res { check_api_err(api_err); } } }, - PaymentSendFailure::AllFailedRetrySafe(per_path_results) => { + PaymentSendFailure::AllFailedResendSafe(per_path_results) => { for api_err in per_path_results { check_api_err(api_err); } }, PaymentSendFailure::PartialFailure { results, .. } => { for res in results { if let Err(api_err) = res { check_api_err(api_err); } } }, + PaymentSendFailure::DuplicatePayment => panic!(), } } -type ChanMan = ChannelManager, Arc, Arc, Arc, Arc>; +type ChanMan = ChannelManager, Arc, Arc, Arc, Arc>; #[inline] fn get_payment_secret_hash(dest: &ChanMan, payment_id: &mut u8) -> Option<(PaymentSecret, PaymentHash)> { @@ -308,9 +314,12 @@ fn get_payment_secret_hash(dest: &ChanMan, payment_id: &mut u8) -> Option<(Payme } #[inline] -fn send_payment(source: &ChanMan, dest: &ChanMan, dest_chan_id: u64, amt: u64, payment_id: &mut u8) -> bool { +fn send_payment(source: &ChanMan, dest: &ChanMan, dest_chan_id: u64, amt: u64, payment_id: &mut u8, payment_idx: &mut u64) -> bool { let (payment_secret, payment_hash) = if let Some((secret, hash)) = get_payment_secret_hash(dest, payment_id) { (secret, hash) } else { return true; }; + let mut payment_id = [0; 32]; + payment_id[0..8].copy_from_slice(&payment_idx.to_ne_bytes()); + *payment_idx += 1; if let Err(err) = source.send_payment(&Route { paths: vec![vec![RouteHop { pubkey: dest.get_our_node_id(), @@ -321,15 +330,18 @@ fn send_payment(source: &ChanMan, dest: &ChanMan, dest_chan_id: u64, amt: u64, p cltv_expiry_delta: 200, }]], payment_params: None, - }, payment_hash, &Some(payment_secret)) { + }, payment_hash, &Some(payment_secret), PaymentId(payment_id)) { check_payment_err(err); false } else { true } } #[inline] -fn send_hop_payment(source: &ChanMan, middle: &ChanMan, middle_chan_id: u64, dest: &ChanMan, dest_chan_id: u64, amt: u64, payment_id: &mut u8) -> bool { +fn send_hop_payment(source: &ChanMan, middle: &ChanMan, middle_chan_id: u64, dest: &ChanMan, dest_chan_id: u64, amt: u64, payment_id: &mut u8, payment_idx: &mut u64) -> bool { let (payment_secret, payment_hash) = if let Some((secret, hash)) = get_payment_secret_hash(dest, payment_id) { (secret, hash) } else { return true; }; + let mut payment_id = [0; 32]; + payment_id[0..8].copy_from_slice(&payment_idx.to_ne_bytes()); + *payment_idx += 1; if let Err(err) = source.send_payment(&Route { paths: vec![vec![RouteHop { pubkey: middle.get_our_node_id(), @@ -347,7 +359,7 @@ fn send_hop_payment(source: &ChanMan, middle: &ChanMan, middle_chan_id: u64, des cltv_expiry_delta: 200, }]], payment_params: None, - }, payment_hash, &Some(payment_secret)) { + }, payment_hash, &Some(payment_secret), PaymentId(payment_id)) { check_payment_err(err); false } else { true } @@ -553,6 +565,7 @@ pub fn do_test(data: &[u8], underlying_out: Out) { let chan_b = nodes[2].list_usable_channels()[0].short_channel_id.unwrap(); let mut payment_id: u8 = 0; + let mut payment_idx: u64 = 0; let mut chan_a_disconnected = false; let mut chan_b_disconnected = false; @@ -835,16 +848,16 @@ pub fn do_test(data: &[u8], underlying_out: Out) { let mut events = nodes[$node].get_and_clear_pending_events(); // Sort events so that PendingHTLCsForwardable get processed last. This avoids a // case where we first process a PendingHTLCsForwardable, then claim/fail on a - // PaymentReceived, claiming/failing two HTLCs, but leaving a just-generated - // PaymentReceived event for the second HTLC in our pending_events (and breaking + // PaymentClaimable, claiming/failing two HTLCs, but leaving a just-generated + // PaymentClaimable event for the second HTLC in our pending_events (and breaking // our claim_set deduplication). events.sort_by(|a, b| { - if let events::Event::PaymentReceived { .. } = a { + if let events::Event::PaymentClaimable { .. } = a { if let events::Event::PendingHTLCsForwardable { .. } = b { Ordering::Less } else { Ordering::Equal } } else if let events::Event::PendingHTLCsForwardable { .. } = a { - if let events::Event::PaymentReceived { .. } = b { + if let events::Event::PaymentClaimable { .. } = b { Ordering::Greater } else { Ordering::Equal } } else { Ordering::Equal } @@ -852,7 +865,7 @@ pub fn do_test(data: &[u8], underlying_out: Out) { let had_events = !events.is_empty(); for event in events.drain(..) { match event { - events::Event::PaymentReceived { payment_hash, .. } => { + events::Event::PaymentClaimable { payment_hash, .. } => { if claim_set.insert(payment_hash.0) { if $fail { nodes[$node].fail_htlc_backwards(&payment_hash); @@ -872,6 +885,7 @@ pub fn do_test(data: &[u8], underlying_out: Out) { // looking like probes. }, events::Event::PaymentForwarded { .. } if $node == 1 => {}, + events::Event::ChannelReady { .. } => {}, events::Event::PendingHTLCsForwardable { .. } => { nodes[$node].process_pending_htlc_forwards(); }, @@ -1036,61 +1050,61 @@ pub fn do_test(data: &[u8], underlying_out: Out) { }, // 1/10th the channel size: - 0x30 => { send_payment(&nodes[0], &nodes[1], chan_a, 10_000_000, &mut payment_id); }, - 0x31 => { send_payment(&nodes[1], &nodes[0], chan_a, 10_000_000, &mut payment_id); }, - 0x32 => { send_payment(&nodes[1], &nodes[2], chan_b, 10_000_000, &mut payment_id); }, - 0x33 => { send_payment(&nodes[2], &nodes[1], chan_b, 10_000_000, &mut payment_id); }, - 0x34 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 10_000_000, &mut payment_id); }, - 0x35 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 10_000_000, &mut payment_id); }, - - 0x38 => { send_payment(&nodes[0], &nodes[1], chan_a, 1_000_000, &mut payment_id); }, - 0x39 => { send_payment(&nodes[1], &nodes[0], chan_a, 1_000_000, &mut payment_id); }, - 0x3a => { send_payment(&nodes[1], &nodes[2], chan_b, 1_000_000, &mut payment_id); }, - 0x3b => { send_payment(&nodes[2], &nodes[1], chan_b, 1_000_000, &mut payment_id); }, - 0x3c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 1_000_000, &mut payment_id); }, - 0x3d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 1_000_000, &mut payment_id); }, - - 0x40 => { send_payment(&nodes[0], &nodes[1], chan_a, 100_000, &mut payment_id); }, - 0x41 => { send_payment(&nodes[1], &nodes[0], chan_a, 100_000, &mut payment_id); }, - 0x42 => { send_payment(&nodes[1], &nodes[2], chan_b, 100_000, &mut payment_id); }, - 0x43 => { send_payment(&nodes[2], &nodes[1], chan_b, 100_000, &mut payment_id); }, - 0x44 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 100_000, &mut payment_id); }, - 0x45 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 100_000, &mut payment_id); }, - - 0x48 => { send_payment(&nodes[0], &nodes[1], chan_a, 10_000, &mut payment_id); }, - 0x49 => { send_payment(&nodes[1], &nodes[0], chan_a, 10_000, &mut payment_id); }, - 0x4a => { send_payment(&nodes[1], &nodes[2], chan_b, 10_000, &mut payment_id); }, - 0x4b => { send_payment(&nodes[2], &nodes[1], chan_b, 10_000, &mut payment_id); }, - 0x4c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 10_000, &mut payment_id); }, - 0x4d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 10_000, &mut payment_id); }, - - 0x50 => { send_payment(&nodes[0], &nodes[1], chan_a, 1_000, &mut payment_id); }, - 0x51 => { send_payment(&nodes[1], &nodes[0], chan_a, 1_000, &mut payment_id); }, - 0x52 => { send_payment(&nodes[1], &nodes[2], chan_b, 1_000, &mut payment_id); }, - 0x53 => { send_payment(&nodes[2], &nodes[1], chan_b, 1_000, &mut payment_id); }, - 0x54 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 1_000, &mut payment_id); }, - 0x55 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 1_000, &mut payment_id); }, - - 0x58 => { send_payment(&nodes[0], &nodes[1], chan_a, 100, &mut payment_id); }, - 0x59 => { send_payment(&nodes[1], &nodes[0], chan_a, 100, &mut payment_id); }, - 0x5a => { send_payment(&nodes[1], &nodes[2], chan_b, 100, &mut payment_id); }, - 0x5b => { send_payment(&nodes[2], &nodes[1], chan_b, 100, &mut payment_id); }, - 0x5c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 100, &mut payment_id); }, - 0x5d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 100, &mut payment_id); }, - - 0x60 => { send_payment(&nodes[0], &nodes[1], chan_a, 10, &mut payment_id); }, - 0x61 => { send_payment(&nodes[1], &nodes[0], chan_a, 10, &mut payment_id); }, - 0x62 => { send_payment(&nodes[1], &nodes[2], chan_b, 10, &mut payment_id); }, - 0x63 => { send_payment(&nodes[2], &nodes[1], chan_b, 10, &mut payment_id); }, - 0x64 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 10, &mut payment_id); }, - 0x65 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 10, &mut payment_id); }, - - 0x68 => { send_payment(&nodes[0], &nodes[1], chan_a, 1, &mut payment_id); }, - 0x69 => { send_payment(&nodes[1], &nodes[0], chan_a, 1, &mut payment_id); }, - 0x6a => { send_payment(&nodes[1], &nodes[2], chan_b, 1, &mut payment_id); }, - 0x6b => { send_payment(&nodes[2], &nodes[1], chan_b, 1, &mut payment_id); }, - 0x6c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 1, &mut payment_id); }, - 0x6d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 1, &mut payment_id); }, + 0x30 => { send_payment(&nodes[0], &nodes[1], chan_a, 10_000_000, &mut payment_id, &mut payment_idx); }, + 0x31 => { send_payment(&nodes[1], &nodes[0], chan_a, 10_000_000, &mut payment_id, &mut payment_idx); }, + 0x32 => { send_payment(&nodes[1], &nodes[2], chan_b, 10_000_000, &mut payment_id, &mut payment_idx); }, + 0x33 => { send_payment(&nodes[2], &nodes[1], chan_b, 10_000_000, &mut payment_id, &mut payment_idx); }, + 0x34 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 10_000_000, &mut payment_id, &mut payment_idx); }, + 0x35 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 10_000_000, &mut payment_id, &mut payment_idx); }, + + 0x38 => { send_payment(&nodes[0], &nodes[1], chan_a, 1_000_000, &mut payment_id, &mut payment_idx); }, + 0x39 => { send_payment(&nodes[1], &nodes[0], chan_a, 1_000_000, &mut payment_id, &mut payment_idx); }, + 0x3a => { send_payment(&nodes[1], &nodes[2], chan_b, 1_000_000, &mut payment_id, &mut payment_idx); }, + 0x3b => { send_payment(&nodes[2], &nodes[1], chan_b, 1_000_000, &mut payment_id, &mut payment_idx); }, + 0x3c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 1_000_000, &mut payment_id, &mut payment_idx); }, + 0x3d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 1_000_000, &mut payment_id, &mut payment_idx); }, + + 0x40 => { send_payment(&nodes[0], &nodes[1], chan_a, 100_000, &mut payment_id, &mut payment_idx); }, + 0x41 => { send_payment(&nodes[1], &nodes[0], chan_a, 100_000, &mut payment_id, &mut payment_idx); }, + 0x42 => { send_payment(&nodes[1], &nodes[2], chan_b, 100_000, &mut payment_id, &mut payment_idx); }, + 0x43 => { send_payment(&nodes[2], &nodes[1], chan_b, 100_000, &mut payment_id, &mut payment_idx); }, + 0x44 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 100_000, &mut payment_id, &mut payment_idx); }, + 0x45 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 100_000, &mut payment_id, &mut payment_idx); }, + + 0x48 => { send_payment(&nodes[0], &nodes[1], chan_a, 10_000, &mut payment_id, &mut payment_idx); }, + 0x49 => { send_payment(&nodes[1], &nodes[0], chan_a, 10_000, &mut payment_id, &mut payment_idx); }, + 0x4a => { send_payment(&nodes[1], &nodes[2], chan_b, 10_000, &mut payment_id, &mut payment_idx); }, + 0x4b => { send_payment(&nodes[2], &nodes[1], chan_b, 10_000, &mut payment_id, &mut payment_idx); }, + 0x4c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 10_000, &mut payment_id, &mut payment_idx); }, + 0x4d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 10_000, &mut payment_id, &mut payment_idx); }, + + 0x50 => { send_payment(&nodes[0], &nodes[1], chan_a, 1_000, &mut payment_id, &mut payment_idx); }, + 0x51 => { send_payment(&nodes[1], &nodes[0], chan_a, 1_000, &mut payment_id, &mut payment_idx); }, + 0x52 => { send_payment(&nodes[1], &nodes[2], chan_b, 1_000, &mut payment_id, &mut payment_idx); }, + 0x53 => { send_payment(&nodes[2], &nodes[1], chan_b, 1_000, &mut payment_id, &mut payment_idx); }, + 0x54 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 1_000, &mut payment_id, &mut payment_idx); }, + 0x55 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 1_000, &mut payment_id, &mut payment_idx); }, + + 0x58 => { send_payment(&nodes[0], &nodes[1], chan_a, 100, &mut payment_id, &mut payment_idx); }, + 0x59 => { send_payment(&nodes[1], &nodes[0], chan_a, 100, &mut payment_id, &mut payment_idx); }, + 0x5a => { send_payment(&nodes[1], &nodes[2], chan_b, 100, &mut payment_id, &mut payment_idx); }, + 0x5b => { send_payment(&nodes[2], &nodes[1], chan_b, 100, &mut payment_id, &mut payment_idx); }, + 0x5c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 100, &mut payment_id, &mut payment_idx); }, + 0x5d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 100, &mut payment_id, &mut payment_idx); }, + + 0x60 => { send_payment(&nodes[0], &nodes[1], chan_a, 10, &mut payment_id, &mut payment_idx); }, + 0x61 => { send_payment(&nodes[1], &nodes[0], chan_a, 10, &mut payment_id, &mut payment_idx); }, + 0x62 => { send_payment(&nodes[1], &nodes[2], chan_b, 10, &mut payment_id, &mut payment_idx); }, + 0x63 => { send_payment(&nodes[2], &nodes[1], chan_b, 10, &mut payment_id, &mut payment_idx); }, + 0x64 => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 10, &mut payment_id, &mut payment_idx); }, + 0x65 => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 10, &mut payment_id, &mut payment_idx); }, + + 0x68 => { send_payment(&nodes[0], &nodes[1], chan_a, 1, &mut payment_id, &mut payment_idx); }, + 0x69 => { send_payment(&nodes[1], &nodes[0], chan_a, 1, &mut payment_id, &mut payment_idx); }, + 0x6a => { send_payment(&nodes[1], &nodes[2], chan_b, 1, &mut payment_id, &mut payment_idx); }, + 0x6b => { send_payment(&nodes[2], &nodes[1], chan_b, 1, &mut payment_id, &mut payment_idx); }, + 0x6c => { send_hop_payment(&nodes[0], &nodes[1], chan_a, &nodes[2], chan_b, 1, &mut payment_id, &mut payment_idx); }, + 0x6d => { send_hop_payment(&nodes[2], &nodes[1], chan_b, &nodes[0], chan_a, 1, &mut payment_id, &mut payment_idx); }, 0x80 => { let max_feerate = last_htlc_clear_fee_a * FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE as u32; @@ -1173,11 +1187,11 @@ pub fn do_test(data: &[u8], underlying_out: Out) { // Finally, make sure that at least one end of each channel can make a substantial payment assert!( - send_payment(&nodes[0], &nodes[1], chan_a, 10_000_000, &mut payment_id) || - send_payment(&nodes[1], &nodes[0], chan_a, 10_000_000, &mut payment_id)); + send_payment(&nodes[0], &nodes[1], chan_a, 10_000_000, &mut payment_id, &mut payment_idx) || + send_payment(&nodes[1], &nodes[0], chan_a, 10_000_000, &mut payment_id, &mut payment_idx)); assert!( - send_payment(&nodes[1], &nodes[2], chan_b, 10_000_000, &mut payment_id) || - send_payment(&nodes[2], &nodes[1], chan_b, 10_000_000, &mut payment_id)); + send_payment(&nodes[1], &nodes[2], chan_b, 10_000_000, &mut payment_id, &mut payment_idx) || + send_payment(&nodes[2], &nodes[1], chan_b, 10_000_000, &mut payment_id, &mut payment_idx)); last_htlc_clear_fee_a = fee_est_a.ret_val.load(atomic::Ordering::Acquire); last_htlc_clear_fee_b = fee_est_b.ret_val.load(atomic::Ordering::Acquire);