@@ -32,7 +32,6 @@ use bitcoin::script::ScriptBuf;
3232use bitcoin:: hash_types:: Txid ;
3333
3434use crate :: blinded_path:: payment:: { BlindedPaymentTlvs , ForwardTlvs , ReceiveTlvs , UnauthenticatedReceiveTlvs } ;
35- #[ cfg( trampoline) ]
3635use crate :: blinded_path:: payment:: { BlindedTrampolineTlvs , TrampolineForwardTlvs } ;
3736use crate :: ln:: channelmanager:: Verification ;
3837use crate :: ln:: types:: ChannelId ;
@@ -2075,8 +2074,7 @@ mod fuzzy_internal_msgs {
20752074 pub outgoing_cltv_value : u32 ,
20762075 }
20772076
2078- #[ cfg( trampoline) ]
2079- #[ cfg_attr( trampoline, allow( unused) ) ]
2077+ #[ allow( unused) ]
20802078 pub struct InboundTrampolineEntrypointPayload {
20812079 pub amt_to_forward : u64 ,
20822080 pub outgoing_cltv_value : u32 ,
@@ -2118,23 +2116,19 @@ mod fuzzy_internal_msgs {
21182116
21192117 pub enum InboundOnionPayload {
21202118 Forward ( InboundOnionForwardPayload ) ,
2121- #[ cfg( trampoline) ]
2122- #[ cfg_attr( trampoline, allow( unused) ) ]
21232119 TrampolineEntrypoint ( InboundTrampolineEntrypointPayload ) ,
21242120 Receive ( InboundOnionReceivePayload ) ,
21252121 BlindedForward ( InboundOnionBlindedForwardPayload ) ,
21262122 BlindedReceive ( InboundOnionBlindedReceivePayload ) ,
21272123 }
21282124
2129- #[ cfg( trampoline) ]
21302125 pub struct InboundTrampolineForwardPayload {
21312126 pub next_trampoline : PublicKey ,
21322127 /// The value, in msat, of the payment after this hop's fee is deducted.
21332128 pub amt_to_forward : u64 ,
21342129 pub outgoing_cltv_value : u32 ,
21352130 }
21362131
2137- #[ cfg( trampoline) ]
21382132 pub struct InboundTrampolineBlindedForwardPayload {
21392133 pub next_trampoline : PublicKey ,
21402134 pub payment_relay : PaymentRelay ,
@@ -2144,7 +2138,6 @@ mod fuzzy_internal_msgs {
21442138 pub next_blinding_override : Option < PublicKey > ,
21452139 }
21462140
2147- #[ cfg( trampoline) ]
21482141 pub enum InboundTrampolinePayload {
21492142 Forward ( InboundTrampolineForwardPayload ) ,
21502143 BlindedForward ( InboundTrampolineBlindedForwardPayload ) ,
@@ -3239,15 +3232,13 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
32393232 let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
32403233 let mut total_msat = None ;
32413234 let mut keysend_preimage: Option < PaymentPreimage > = None ;
3242- #[ cfg( trampoline) ]
32433235 let mut trampoline_onion_packet: Option < TrampolineOnionPacket > = None ;
32443236 let mut invoice_request: Option < InvoiceRequest > = None ;
32453237 let mut custom_tlvs = Vec :: new ( ) ;
32463238
32473239 let tlv_len = BigSize :: read ( r) ?;
32483240 let mut rd = FixedLengthReader :: new ( r, tlv_len. 0 ) ;
32493241
3250- #[ cfg( trampoline) ]
32513242 decode_tlv_stream_with_custom_tlv_decode ! ( & mut rd, {
32523243 ( 2 , amt, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
32533244 ( 4 , cltv_value, ( option, encoding: ( u32 , HighZeroBytesDroppedBigSize ) ) ) ,
@@ -3268,33 +3259,12 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
32683259 custom_tlvs. push( ( msg_type, value) ) ;
32693260 Ok ( true )
32703261 } ) ;
3271- #[ cfg( not( trampoline) ) ]
3272- decode_tlv_stream_with_custom_tlv_decode ! ( & mut rd, {
3273- ( 2 , amt, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
3274- ( 4 , cltv_value, ( option, encoding: ( u32 , HighZeroBytesDroppedBigSize ) ) ) ,
3275- ( 6 , short_id, option) ,
3276- ( 8 , payment_data, option) ,
3277- ( 10 , encrypted_tlvs_opt, option) ,
3278- ( 12 , intro_node_blinding_point, option) ,
3279- ( 16 , payment_metadata, option) ,
3280- ( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
3281- ( 77_777 , invoice_request, option) ,
3282- // See https://github.com/lightning/blips/blob/master/blip-0003.md
3283- ( 5482373484 , keysend_preimage, option)
3284- } , |msg_type: u64 , msg_reader: & mut FixedLengthReader <_>| -> Result <bool , DecodeError > {
3285- if msg_type < 1 << 16 { return Ok ( false ) }
3286- let mut value = Vec :: new( ) ;
3287- msg_reader. read_to_limit( & mut value, u64 :: MAX ) ?;
3288- custom_tlvs. push( ( msg_type, value) ) ;
3289- Ok ( true )
3290- } ) ;
32913262
32923263 if amt. unwrap_or ( 0 ) > MAX_VALUE_MSAT { return Err ( DecodeError :: InvalidValue ) }
32933264 if intro_node_blinding_point. is_some ( ) && update_add_blinding_point. is_some ( ) {
32943265 return Err ( DecodeError :: InvalidValue )
32953266 }
32963267
3297- #[ cfg( trampoline) ]
32983268 if let Some ( trampoline_onion_packet) = trampoline_onion_packet {
32993269 if payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
33003270 total_msat. is_some ( )
@@ -3391,7 +3361,6 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
33913361 }
33923362}
33933363
3394- #[ cfg( trampoline) ]
33953364impl < NS : Deref > ReadableArgs < ( Option < PublicKey > , NS ) > for InboundTrampolinePayload where NS :: Target : NodeSigner {
33963365 fn read < R : Read > ( r : & mut R , args : ( Option < PublicKey > , NS ) ) -> Result < Self , DecodeError > {
33973366 let ( update_add_blinding_point, node_signer) = args;
0 commit comments