@@ -32,7 +32,6 @@ use bitcoin::script::ScriptBuf;
32
32
use bitcoin:: hash_types:: Txid ;
33
33
34
34
use crate :: blinded_path:: payment:: { BlindedPaymentTlvs , ForwardTlvs , ReceiveTlvs , UnauthenticatedReceiveTlvs } ;
35
- #[ cfg( trampoline) ]
36
35
use crate :: blinded_path:: payment:: { BlindedTrampolineTlvs , TrampolineForwardTlvs } ;
37
36
use crate :: ln:: channelmanager:: Verification ;
38
37
use crate :: ln:: types:: ChannelId ;
@@ -2075,8 +2074,7 @@ mod fuzzy_internal_msgs {
2075
2074
pub outgoing_cltv_value : u32 ,
2076
2075
}
2077
2076
2078
- #[ cfg( trampoline) ]
2079
- #[ cfg_attr( trampoline, allow( unused) ) ]
2077
+ #[ allow( unused) ]
2080
2078
pub struct InboundTrampolineEntrypointPayload {
2081
2079
pub amt_to_forward : u64 ,
2082
2080
pub outgoing_cltv_value : u32 ,
@@ -2118,23 +2116,19 @@ mod fuzzy_internal_msgs {
2118
2116
2119
2117
pub enum InboundOnionPayload {
2120
2118
Forward ( InboundOnionForwardPayload ) ,
2121
- #[ cfg( trampoline) ]
2122
- #[ cfg_attr( trampoline, allow( unused) ) ]
2123
2119
TrampolineEntrypoint ( InboundTrampolineEntrypointPayload ) ,
2124
2120
Receive ( InboundOnionReceivePayload ) ,
2125
2121
BlindedForward ( InboundOnionBlindedForwardPayload ) ,
2126
2122
BlindedReceive ( InboundOnionBlindedReceivePayload ) ,
2127
2123
}
2128
2124
2129
- #[ cfg( trampoline) ]
2130
2125
pub struct InboundTrampolineForwardPayload {
2131
2126
pub next_trampoline : PublicKey ,
2132
2127
/// The value, in msat, of the payment after this hop's fee is deducted.
2133
2128
pub amt_to_forward : u64 ,
2134
2129
pub outgoing_cltv_value : u32 ,
2135
2130
}
2136
2131
2137
- #[ cfg( trampoline) ]
2138
2132
pub struct InboundTrampolineBlindedForwardPayload {
2139
2133
pub next_trampoline : PublicKey ,
2140
2134
pub payment_relay : PaymentRelay ,
@@ -2144,7 +2138,6 @@ mod fuzzy_internal_msgs {
2144
2138
pub next_blinding_override : Option < PublicKey > ,
2145
2139
}
2146
2140
2147
- #[ cfg( trampoline) ]
2148
2141
pub enum InboundTrampolinePayload {
2149
2142
Forward ( InboundTrampolineForwardPayload ) ,
2150
2143
BlindedForward ( InboundTrampolineBlindedForwardPayload ) ,
@@ -3239,15 +3232,13 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
3239
3232
let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
3240
3233
let mut total_msat = None ;
3241
3234
let mut keysend_preimage: Option < PaymentPreimage > = None ;
3242
- #[ cfg( trampoline) ]
3243
3235
let mut trampoline_onion_packet: Option < TrampolineOnionPacket > = None ;
3244
3236
let mut invoice_request: Option < InvoiceRequest > = None ;
3245
3237
let mut custom_tlvs = Vec :: new ( ) ;
3246
3238
3247
3239
let tlv_len = BigSize :: read ( r) ?;
3248
3240
let mut rd = FixedLengthReader :: new ( r, tlv_len. 0 ) ;
3249
3241
3250
- #[ cfg( trampoline) ]
3251
3242
decode_tlv_stream_with_custom_tlv_decode ! ( & mut rd, {
3252
3243
( 2 , amt, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
3253
3244
( 4 , cltv_value, ( option, encoding: ( u32 , HighZeroBytesDroppedBigSize ) ) ) ,
@@ -3268,33 +3259,12 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
3268
3259
custom_tlvs. push( ( msg_type, value) ) ;
3269
3260
Ok ( true )
3270
3261
} ) ;
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
- } ) ;
3291
3262
3292
3263
if amt. unwrap_or ( 0 ) > MAX_VALUE_MSAT { return Err ( DecodeError :: InvalidValue ) }
3293
3264
if intro_node_blinding_point. is_some ( ) && update_add_blinding_point. is_some ( ) {
3294
3265
return Err ( DecodeError :: InvalidValue )
3295
3266
}
3296
3267
3297
- #[ cfg( trampoline) ]
3298
3268
if let Some ( trampoline_onion_packet) = trampoline_onion_packet {
3299
3269
if payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
3300
3270
total_msat. is_some ( )
@@ -3391,7 +3361,6 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
3391
3361
}
3392
3362
}
3393
3363
3394
- #[ cfg( trampoline) ]
3395
3364
impl < NS : Deref > ReadableArgs < ( Option < PublicKey > , NS ) > for InboundTrampolinePayload where NS :: Target : NodeSigner {
3396
3365
fn read < R : Read > ( r : & mut R , args : ( Option < PublicKey > , NS ) ) -> Result < Self , DecodeError > {
3397
3366
let ( update_add_blinding_point, node_signer) = args;
0 commit comments