You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This required adapting `onion_utils::decode_next_hop` to work for both payments
and onion messages.
Currently we just print out the path_id of any onion messages we receive. In
the future, these received onion messages will be redirected to their
respective handlers: i.e. an invoice_request will go to an InvoiceHandler,
custom onion messages will go to a custom handler, etc.
let next_hop = match onion_utils::decode_next_hop(shared_secret,&msg.onion_routing_packet.hop_data[..], msg.onion_routing_packet.hmac, msg.payment_hash){
2153
+
let next_hop = match onion_utils::decode_next_payment_hop(shared_secret,&msg.onion_routing_packet.hop_data[..], msg.onion_routing_packet.hmac, msg.payment_hash){
Copy file name to clipboardExpand all lines: lightning/src/onion_message.rs
+130-4
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,13 @@ use bitcoin::hashes::sha256::Hash as Sha256;
14
14
use bitcoin::secp256k1::{self,PublicKey,Secp256k1,SecretKey};
15
15
use bitcoin::secp256k1::ecdh::SharedSecret;
16
16
17
-
use chain::keysinterface::{InMemorySigner,KeysInterface,KeysManager,Sign};
17
+
use chain::keysinterface::{InMemorySigner,KeysInterface,KeysManager,Recipient,Sign};
18
18
use ln::msgs::{self,DecodeError,OnionMessageHandler};
19
19
use ln::onion_utils;
20
-
use util::chacha20poly1305rfc::ChaChaPolyWriteAdapter;
20
+
use util::chacha20poly1305rfc::{ChaChaPolyReadAdapter,ChaChaPolyWriteAdapter};
21
21
use util::events::{MessageSendEvent,MessageSendEventsProvider};
22
22
use util::logger::Logger;
23
-
use util::ser::{IgnoringLengthReadable,LengthRead,LengthReadable,Readable,VecWriter,Writeable,Writer};
23
+
use util::ser::{FixedLengthReader,IgnoringLengthReadable,LengthRead,LengthReadable,LengthReadableArgs,Readable,ReadableArgs,VecWriter,Writeable,Writer};
match onion_utils::decode_next_message_hop(onion_decode_shared_secret,&msg.onion_routing_packet.hop_data[..], msg.onion_routing_packet.hmac, encrypted_data_ss){
0 commit comments