@@ -14,7 +14,7 @@ use bitcoin::hashes::sha256::Hash as Sha256;
14
14
use bitcoin:: secp256k1:: { self , PublicKey , Secp256k1 , SecretKey } ;
15
15
16
16
use crate :: blinded_path:: { BlindedHop , BlindedPath , IntroductionNode , NodeIdLookUp } ;
17
- use crate :: blinded_path:: utils;
17
+ use crate :: blinded_path:: utils:: { self , BlindedPathWithPadding } ;
18
18
use crate :: crypto:: streams:: ChaChaPolyReadAdapter ;
19
19
use crate :: io;
20
20
use crate :: io:: Cursor ;
@@ -493,6 +493,10 @@ impl Readable for BlindedPaymentTlvs {
493
493
}
494
494
}
495
495
496
+ /// Represents the padding round off size (in bytes) that
497
+ /// is used to pad payment bilnded path's [`BlindedHop`]
498
+ pub ( crate ) const PAYMENT_PADDING_ROUND_OFF : usize = 35 ;
499
+
496
500
/// Construct blinded payment hops for the given `intermediate_nodes` and payee info.
497
501
pub ( super ) fn blinded_hops < T : secp256k1:: Signing + secp256k1:: Verification > (
498
502
secp_ctx : & Secp256k1 < T > , intermediate_nodes : & [ PaymentForwardNode ] ,
@@ -503,7 +507,7 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
503
507
let tlvs = intermediate_nodes. iter ( ) . map ( |node| BlindedPaymentTlvsRef :: Forward ( & node. tlvs ) )
504
508
. chain ( core:: iter:: once ( BlindedPaymentTlvsRef :: Receive ( & payee_tlvs) ) ) ;
505
509
506
- let path = pks. zip ( tlvs) ;
510
+ let path = pks. zip ( tlvs. map ( |tlv| BlindedPathWithPadding { tlvs : tlv , round_off : PAYMENT_PADDING_ROUND_OFF } ) ) ;
507
511
508
512
utils:: construct_blinded_hops ( secp_ctx, path, session_priv)
509
513
}
0 commit comments