@@ -14,7 +14,7 @@ use bitcoin::hashes::sha256::Hash as Sha256;
14
14
use bitcoin:: secp256k1:: ecdh:: SharedSecret ;
15
15
use bitcoin:: secp256k1:: { self , PublicKey , Secp256k1 , SecretKey } ;
16
16
17
- use crate :: blinded_path:: utils;
17
+ use crate :: blinded_path:: utils:: { self , BlindedPathWithPadding } ;
18
18
use crate :: blinded_path:: { BlindedHop , BlindedPath , IntroductionNode , NodeIdLookUp } ;
19
19
use crate :: crypto:: streams:: ChaChaPolyReadAdapter ;
20
20
use crate :: io;
@@ -560,6 +560,10 @@ impl Readable for BlindedPaymentTlvs {
560
560
}
561
561
}
562
562
563
+ /// Represents the padding round off size (in bytes) that
564
+ /// is used to pad payment bilnded path's [`BlindedHop`]
565
+ pub ( crate ) const PAYMENT_PADDING_ROUND_OFF : usize = 30 ;
566
+
563
567
/// Construct blinded payment hops for the given `intermediate_nodes` and payee info.
564
568
pub ( super ) fn blinded_hops < T : secp256k1:: Signing + secp256k1:: Verification > (
565
569
secp_ctx : & Secp256k1 < T > , intermediate_nodes : & [ PaymentForwardNode ] , payee_node_id : PublicKey ,
@@ -572,7 +576,9 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
572
576
. map ( |node| BlindedPaymentTlvsRef :: Forward ( & node. tlvs ) )
573
577
. chain ( core:: iter:: once ( BlindedPaymentTlvsRef :: Receive ( & payee_tlvs) ) ) ;
574
578
575
- let path = pks. zip ( tlvs) ;
579
+ let path = pks. zip (
580
+ tlvs. map ( |tlv| BlindedPathWithPadding { tlvs : tlv, round_off : PAYMENT_PADDING_ROUND_OFF } ) ,
581
+ ) ;
576
582
577
583
utils:: construct_blinded_hops ( secp_ctx, path, session_priv)
578
584
}
0 commit comments