mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-14 18:44:19 +01:00
paymod: Implement legacy onion payload computation
This is just for testing for now, TLV payload computation will come next. We stage all the payloads in deserialized form so modifiers can modify them more easily and serialize them only before actually calling `createonion`.
This commit is contained in:
@@ -19,6 +19,27 @@ struct route_hop {
|
||||
enum route_hop_style style;
|
||||
};
|
||||
|
||||
struct legacy_payload {
|
||||
struct short_channel_id scid;
|
||||
struct amount_msat forward_amt;
|
||||
u32 outgoing_cltv;
|
||||
};
|
||||
|
||||
/* struct holding the information necessary to call createonion */
|
||||
struct createonion_hop {
|
||||
struct node_id pubkey;
|
||||
|
||||
enum route_hop_style style;
|
||||
struct tlv_tlv_payload *tlv_payload;
|
||||
struct legacy_payload *legacy_payload;
|
||||
};
|
||||
|
||||
struct createonion_request {
|
||||
struct createonion_hop *hops;
|
||||
u8 *assocdata;
|
||||
struct secret *session_key;
|
||||
};
|
||||
|
||||
/* A parsed version of the possible outcomes that a sendpay / payment may
|
||||
* result in. */
|
||||
struct payment_result {
|
||||
@@ -82,6 +103,8 @@ struct payment {
|
||||
* paths to amend the route later in a mixin. */
|
||||
struct node_id *getroute_destination;
|
||||
|
||||
struct createonion_request *createonion_request;
|
||||
|
||||
/* Target amount to be delivered at the destination */
|
||||
struct amount_msat amount;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user