X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fonion_utils.rs;h=666221b2dd47fbe400b506d7602435905f9a2010;hb=259ceb0ebfe7082e2dfebc39a2ad7edefea56b19;hp=8782323ea77333d0ce1e46a17c17aebea2580051;hpb=7b1e09134afd256aa3a5465b51cac90bf9e2ab00;p=rust-lightning diff --git a/lightning/src/ln/onion_utils.rs b/lightning/src/ln/onion_utils.rs index 8782323e..666221b2 100644 --- a/lightning/src/ln/onion_utils.rs +++ b/lightning/src/ln/onion_utils.rs @@ -13,6 +13,7 @@ use crate::ln::msgs; use crate::ln::wire::Encode; use crate::routing::gossip::NetworkUpdate; use crate::routing::router::{BlindedTail, Path, RouteHop}; +use crate::sign::NodeSigner; use crate::util::chacha20::{ChaCha20, ChaChaReader}; use crate::util::errors::{self, APIError}; use crate::util::ser::{Readable, ReadableArgs, Writeable, Writer, LengthCalculatingWriter}; @@ -885,8 +886,11 @@ pub(crate) enum OnionDecodeErr { }, } -pub(crate) fn decode_next_payment_hop(shared_secret: [u8; 32], hop_data: &[u8], hmac_bytes: [u8; 32], payment_hash: PaymentHash) -> Result { - match decode_next_hop(shared_secret, hop_data, hmac_bytes, Some(payment_hash), ()) { +pub(crate) fn decode_next_payment_hop( + shared_secret: [u8; 32], hop_data: &[u8], hmac_bytes: [u8; 32], payment_hash: PaymentHash, + node_signer: &NS, +) -> Result where NS::Target: NodeSigner { + match decode_next_hop(shared_secret, hop_data, hmac_bytes, Some(payment_hash), node_signer) { Ok((next_hop_data, None)) => Ok(Hop::Receive(next_hop_data)), Ok((next_hop_data, Some((next_hop_hmac, FixedSizeOnionPacket(new_packet_bytes))))) => { Ok(Hop::Forward {