}
}
- pub(super) fn send_payment<K: Deref, F>(&self, route: &Route, payment_hash: PaymentHash,
- payment_secret: &Option<PaymentSecret>, payment_id: PaymentId, keys_manager: &K,
- best_block_height: u32, send_payment_along_path: F)
- -> Result<(), PaymentSendFailure>
+ pub(super) fn send_payment<K: Deref, F>(
+ &self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>,
+ payment_id: PaymentId, keys_manager: &K, best_block_height: u32, send_payment_along_path: F
+ ) -> Result<(), PaymentSendFailure>
where
K::Target: KeysInterface,
F: Fn(&Vec<RouteHop>, &Option<PaymentParameters>, &PaymentHash, &Option<PaymentSecret>, u64,
self.send_payment_internal(route, payment_hash, payment_secret, None, payment_id, None, onion_session_privs, keys_manager, best_block_height, send_payment_along_path)
}
- pub(super) fn send_spontaneous_payment<K: Deref, F>(&self, route: &Route,
- payment_preimage: Option<PaymentPreimage>, payment_id: PaymentId, keys_manager: &K,
- best_block_height: u32, send_payment_along_path: F)
- -> Result<PaymentHash, PaymentSendFailure>
+ pub(super) fn send_spontaneous_payment<K: Deref, F>(
+ &self, route: &Route, payment_preimage: Option<PaymentPreimage>, payment_id: PaymentId,
+ keys_manager: &K, best_block_height: u32, send_payment_along_path: F
+ ) -> Result<PaymentHash, PaymentSendFailure>
where
K::Target: KeysInterface,
F: Fn(&Vec<RouteHop>, &Option<PaymentParameters>, &PaymentHash, &Option<PaymentSecret>, u64,
}
}
- pub(super) fn retry_payment<K: Deref, F>(&self, route: &Route, payment_id: PaymentId,
- keys_manager: &K, best_block_height: u32, send_payment_along_path: F)
- -> Result<(), PaymentSendFailure>
+ pub(super) fn retry_payment<K: Deref, F>(
+ &self, route: &Route, payment_id: PaymentId, keys_manager: &K, best_block_height: u32,
+ send_payment_along_path: F
+ ) -> Result<(), PaymentSendFailure>
where
K::Target: KeysInterface,
F: Fn(&Vec<RouteHop>, &Option<PaymentParameters>, &PaymentHash, &Option<PaymentSecret>, u64,
self.send_payment_internal(route, payment_hash, &payment_secret, None, payment_id, Some(total_msat), onion_session_privs, keys_manager, best_block_height, send_payment_along_path)
}
- pub(super) fn send_probe<K: Deref, F>(&self, hops: Vec<RouteHop>, probing_cookie_secret: [u8; 32],
- keys_manager: &K, best_block_height: u32, send_payment_along_path: F)
- -> Result<(PaymentHash, PaymentId), PaymentSendFailure>
+ pub(super) fn send_probe<K: Deref, F>(
+ &self, hops: Vec<RouteHop>, probing_cookie_secret: [u8; 32], keys_manager: &K,
+ best_block_height: u32, send_payment_along_path: F
+ ) -> Result<(PaymentHash, PaymentId), PaymentSendFailure>
where
K::Target: KeysInterface,
F: Fn(&Vec<RouteHop>, &Option<PaymentParameters>, &PaymentHash, &Option<PaymentSecret>, u64,
}
}
- pub(super) fn add_new_pending_payment<K: Deref>(&self, payment_hash: PaymentHash,
- payment_secret: Option<PaymentSecret>, payment_id: PaymentId, route: &Route, keys_manager: &K,
- best_block_height: u32)
- -> Result<Vec<[u8; 32]>, PaymentSendFailure> where K::Target: KeysInterface {
+ pub(super) fn add_new_pending_payment<K: Deref>(
+ &self, payment_hash: PaymentHash, payment_secret: Option<PaymentSecret>, payment_id: PaymentId,
+ route: &Route, keys_manager: &K, best_block_height: u32
+ ) -> Result<Vec<[u8; 32]>, PaymentSendFailure> where K::Target: KeysInterface {
let mut onion_session_privs = Vec::with_capacity(route.paths.len());
for _ in 0..route.paths.len() {
onion_session_privs.push(keys_manager.get_secure_random_bytes());
}
}
- fn send_payment_internal<K: Deref, F>
- (&self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>,
+ fn send_payment_internal<K: Deref, F>(
+ &self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>,
keysend_preimage: Option<PaymentPreimage>, payment_id: PaymentId, recv_value_msat: Option<u64>,
onion_session_privs: Vec<[u8; 32]>, keys_manager: &K, best_block_height: u32,
send_payment_along_path: F) -> Result<(), PaymentSendFailure>
}
#[cfg(test)]
- pub(super) fn test_send_payment_internal<K: Deref, F>
- (&self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>,
- keysend_preimage: Option<PaymentPreimage>, payment_id: PaymentId, recv_value_msat: Option<u64>,
- onion_session_privs: Vec<[u8; 32]>, keys_manager: &K, best_block_height: u32,
- send_payment_along_path: F) -> Result<(), PaymentSendFailure>
+ pub(super) fn test_send_payment_internal<K: Deref, F>(
+ &self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>,
+ keysend_preimage: Option<PaymentPreimage>, payment_id: PaymentId, recv_value_msat: Option<u64>,
+ onion_session_privs: Vec<[u8; 32]>, keys_manager: &K, best_block_height: u32,
+ send_payment_along_path: F) -> Result<(), PaymentSendFailure>
where
K::Target: KeysInterface,
F: Fn(&Vec<RouteHop>, &Option<PaymentParameters>, &PaymentHash, &Option<PaymentSecret>, u64,
send_payment_along_path)
}
- pub(super) fn claim_htlc<L: Deref>(&self, payment_id: PaymentId,
- payment_preimage: PaymentPreimage, session_priv: SecretKey, path: Vec<RouteHop>,
- from_onchain: bool, pending_events: &Mutex<Vec<events::Event>>, logger: &L)
+ pub(super) fn claim_htlc<L: Deref>(
+ &self, payment_id: PaymentId, payment_preimage: PaymentPreimage, session_priv: SecretKey,
+ path: Vec<RouteHop>, from_onchain: bool, pending_events: &Mutex<Vec<events::Event>>, logger: &L)
where L::Target: Logger {
let mut session_priv_bytes = [0; 32];
session_priv_bytes.copy_from_slice(&session_priv[..]);
});
}
- pub(super) fn fail_htlc<L: Deref>(&self, source: &HTLCSource, payment_hash: &PaymentHash,
- onion_error: &HTLCFailReason, path: &Vec<RouteHop>, session_priv: &SecretKey,
- payment_id: &PaymentId, payment_params: &Option<PaymentParameters>,
- probing_cookie_secret: [u8; 32], secp_ctx: &Secp256k1<secp256k1::All>,
- pending_events: &Mutex<Vec<events::Event>>, logger: &L)
+ pub(super) fn fail_htlc<L: Deref>(
+ &self, source: &HTLCSource, payment_hash: &PaymentHash, onion_error: &HTLCFailReason,
+ path: &Vec<RouteHop>, session_priv: &SecretKey, payment_id: &PaymentId,
+ payment_params: &Option<PaymentParameters>, probing_cookie_secret: [u8; 32],
+ secp_ctx: &Secp256k1<secp256k1::All>, pending_events: &Mutex<Vec<events::Event>>, logger: &L)
where L::Target: Logger {
let mut session_priv_bytes = [0; 32];
session_priv_bytes.copy_from_slice(&session_priv[..]);