expose: get_address reset method
This commit is contained in:
		
							parent
							
								
									5fa0b916a2
								
							
						
					
					
						commit
						13043065b6
					
				| @ -58,6 +58,7 @@ interface AddressIndex { | |||||||
|   New(); |   New(); | ||||||
|   LastUnused(); |   LastUnused(); | ||||||
|   Peek(u32 index); |   Peek(u32 index); | ||||||
|  |   Reset(u32 index); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| enum Network { | enum Network { | ||||||
|  | |||||||
| @ -74,6 +74,14 @@ pub enum AddressIndex { | |||||||
|     /// Use with caution, if an index is given that is less than the current descriptor index
 |     /// Use with caution, if an index is given that is less than the current descriptor index
 | ||||||
|     /// then the returned address may have already been used.
 |     /// then the returned address may have already been used.
 | ||||||
|     Peek { index: u32 }, |     Peek { index: u32 }, | ||||||
|  |     /// Return the address for a specific descriptor index and reset the current descriptor index
 | ||||||
|  |     /// used by `AddressIndex::New` and `AddressIndex::LastUsed` to this value.
 | ||||||
|  |     /// Use with caution, if an index is given that is less than the current descriptor index
 | ||||||
|  |     /// then the returned address and subsequent addresses returned by calls to `AddressIndex::New`
 | ||||||
|  |     /// and `AddressIndex::LastUsed` may have already been used. Also if the index is reset to a
 | ||||||
|  |     /// value earlier than the [`crate::blockchain::Blockchain`] stop_gap (default is 20) then a
 | ||||||
|  |     /// larger stop_gap should be used to monitor for all possibly used addresses.
 | ||||||
|  |     Reset { index: u32 }, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl From<AddressIndex> for BdkAddressIndex { | impl From<AddressIndex> for BdkAddressIndex { | ||||||
| @ -82,6 +90,7 @@ impl From<AddressIndex> for BdkAddressIndex { | |||||||
|             AddressIndex::New => BdkAddressIndex::New, |             AddressIndex::New => BdkAddressIndex::New, | ||||||
|             AddressIndex::LastUnused => BdkAddressIndex::LastUnused, |             AddressIndex::LastUnused => BdkAddressIndex::LastUnused, | ||||||
|             AddressIndex::Peek { index } => BdkAddressIndex::Peek(index), |             AddressIndex::Peek { index } => BdkAddressIndex::Peek(index), | ||||||
|  |             AddressIndex::Reset { index } => BdkAddressIndex::Reset(index), | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user