@@ -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 ;
@@ -495,6 +495,10 @@ impl Readable for BlindedPaymentTlvs {
495
495
}
496
496
}
497
497
498
+ /// Represents the padding round off size (in bytes) that
499
+ /// is used to pad payment bilnded path's [`BlindedHop`]
500
+ pub ( crate ) const PAYMENT_PADDING_ROUND_OFF : usize = 35 ;
501
+
498
502
/// Construct blinded payment hops for the given `intermediate_nodes` and payee info.
499
503
pub ( super ) fn blinded_hops < T : secp256k1:: Signing + secp256k1:: Verification > (
500
504
secp_ctx : & Secp256k1 < T > , intermediate_nodes : & [ PaymentForwardNode ] ,
@@ -505,7 +509,7 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
505
509
let tlvs = intermediate_nodes. iter ( ) . map ( |node| BlindedPaymentTlvsRef :: Forward ( & node. tlvs ) )
506
510
. chain ( core:: iter:: once ( BlindedPaymentTlvsRef :: Receive ( & payee_tlvs) ) ) ;
507
511
508
- let path = pks. zip ( tlvs) ;
512
+ let path = pks. zip ( tlvs. map ( |tlv| BlindedPathWithPadding { tlvs : tlv , round_off : PAYMENT_PADDING_ROUND_OFF } ) ) ;
509
513
510
514
utils:: construct_blinded_hops ( secp_ctx, path, session_priv)
511
515
}
0 commit comments