@@ -189,7 +189,7 @@ impl WalletWatcher {
189189#[ derive( Debug , Clone ) ]
190190pub struct Wallet {
191191 desc : ExtendedDescriptor ,
192- is_ranged : bool ,
192+ is_wildcard : bool ,
193193 checksum : Checksum ,
194194 keys_info : Vec < DescKeyInfo > ,
195195 network : Network ,
@@ -218,13 +218,13 @@ impl Wallet {
218218
219219 let checksum = Checksum :: from ( & desc) ;
220220 let keys_info = DescKeyInfo :: extract ( & desc, network) ?;
221- let is_ranged = keys_info. iter ( ) . any ( |x| x. is_ranged ) ;
221+ let is_wildcard = keys_info. iter ( ) . any ( |x| x. is_wildcard ) ;
222222
223223 Ok ( Self {
224224 desc,
225225 checksum,
226226 keys_info,
227- is_ranged ,
227+ is_wildcard ,
228228 network,
229229 gap_limit,
230230 // setting initial_import_size < gap_limit makes no sense, the user probably meant to increase both
@@ -281,7 +281,7 @@ impl Wallet {
281281
282282 /// Returns the maximum index that needs to be watched
283283 fn watch_index ( & self ) -> u32 {
284- if !self . is_ranged {
284+ if !self . is_wildcard {
285285 return 0 ;
286286 }
287287
@@ -326,7 +326,7 @@ impl Wallet {
326326 }
327327
328328 pub fn get_next_index ( & self ) -> u32 {
329- if self . is_ranged {
329+ if self . is_wildcard {
330330 self . max_funded_index
331331 . map_or ( 0 , |max_funded_index| max_funded_index + 1 )
332332 } else {
@@ -335,7 +335,7 @@ impl Wallet {
335335 }
336336
337337 pub fn is_valid_index ( & self , index : u32 ) -> bool {
338- if self . is_ranged {
338+ if self . is_wildcard {
339339 // non-hardended derivation only
340340 index & ( 1 << 31 ) == 0
341341 } else {
@@ -347,7 +347,7 @@ impl Wallet {
347347 // return None if this wallet has no history at all
348348 let max_funded_index = self . max_funded_index ?;
349349
350- Some ( if self . is_ranged {
350+ Some ( if self . is_wildcard {
351351 ( 0 ..=max_funded_index)
352352 . map ( |derivation_index| self . derive_address ( derivation_index) )
353353 . fold ( ( 0 , 0 ) , |( curr_gap, max_gap) , address| {
@@ -368,7 +368,7 @@ impl Wallet {
368368 self . keys_info
369369 . iter ( )
370370 . map ( |i| {
371- if i. is_ranged {
371+ if i. is_wildcard {
372372 i. bip32_origin . child ( index. into ( ) )
373373 } else {
374374 i. bip32_origin . clone ( )
@@ -485,7 +485,7 @@ impl Serialize for Wallet {
485485
486486 rgb. serialize_field ( "desc" , & desc_str) ?;
487487 rgb. serialize_field ( "network" , & self . network ) ?;
488- rgb. serialize_field ( "is_ranged " , & self . is_ranged ) ?;
488+ rgb. serialize_field ( "is_wildcard " , & self . is_wildcard ) ?;
489489 rgb. serialize_field ( "bip32_origins" , & bip32_origins) ?;
490490 rgb. serialize_field ( "rescan_since" , & self . rescan_since ) ?;
491491 rgb. serialize_field ( "done_initial_import" , & self . done_initial_import ) ?;
@@ -496,7 +496,7 @@ impl Serialize for Wallet {
496496 & self . desc . max_satisfaction_weight ( * DESC_CTX ) ,
497497 ) ?;
498498
499- if self . is_ranged {
499+ if self . is_wildcard {
500500 rgb. serialize_field ( "gap_limit" , & self . gap_limit ) ?;
501501 rgb. serialize_field ( "initial_import_size" , & self . initial_import_size ) ?;
502502 }
0 commit comments