@@ -90,7 +90,7 @@ use crate::ln::channelmanager::PaymentId;
90
90
use crate :: ln:: features:: OfferFeatures ;
91
91
use crate :: ln:: inbound_payment:: { ExpandedKey , IV_LEN } ;
92
92
use crate :: ln:: msgs:: { DecodeError , MAX_VALUE_MSAT } ;
93
- use crate :: offers:: merkle:: { TaggedHash , TlvStream } ;
93
+ use crate :: offers:: merkle:: { TaggedHash , TlvRecord , TlvStream } ;
94
94
use crate :: offers:: nonce:: Nonce ;
95
95
use crate :: offers:: parse:: { Bech32Encode , Bolt12ParseError , Bolt12SemanticError , ParsedMessage } ;
96
96
use crate :: offers:: signer:: { Metadata , MetadataMaterial , self } ;
@@ -128,7 +128,7 @@ impl OfferId {
128
128
}
129
129
130
130
fn from_valid_invreq_tlv_stream ( bytes : & [ u8 ] ) -> Self {
131
- let tlv_stream = TlvStream :: new ( bytes) . range ( OFFER_TYPES ) ;
131
+ let tlv_stream = Offer :: tlv_stream_iter ( bytes) ;
132
132
let tagged_hash = TaggedHash :: from_tlv_stream ( Self :: ID_TAG , tlv_stream) ;
133
133
Self ( tagged_hash. to_bytes ( ) )
134
134
}
@@ -687,6 +687,12 @@ impl Offer {
687
687
self . contents . expects_quantity ( )
688
688
}
689
689
690
+ pub ( super ) fn tlv_stream_iter < ' a > (
691
+ bytes : & ' a [ u8 ]
692
+ ) -> impl core:: iter:: Iterator < Item = TlvRecord < ' a > > {
693
+ TlvStream :: new ( bytes) . range ( OFFER_TYPES )
694
+ }
695
+
690
696
#[ cfg( async_payments) ]
691
697
pub ( super ) fn verify < T : secp256k1:: Signing > (
692
698
& self , nonce : Nonce , key : & ExpandedKey , secp_ctx : & Secp256k1 < T >
0 commit comments