pub struct ReserveDestination { /* private fields */ }
Expand description
| A wrapper to reserve an address from | a wallet | | ReserveDestination is used to reserve | an address. | | It is currently only used inside of CreateTransaction. | | Instantiating a ReserveDestination | does not reserve an address. To do so, | | GetReservedDestination() needs to | be called on the object. Once an address | has been reserved, call KeepDestination() | on the ReserveDestination object to | make sure it is not returned. Call ReturnDestination() | to return the address so it can be re-used | (for example, if the address was used | in a new transaction and that transaction | was not completed and needed to be aborted). | | If an address is reserved and KeepDestination() | is not called, then the address will | be returned when the ReserveDestination | goes out of scope. |
Implementations§
source§impl ReserveDestination
impl ReserveDestination
sourcepub fn new(pwallet: *mut Wallet, ty: OutputType) -> Self
pub fn new(pwallet: *mut Wallet, ty: OutputType) -> Self
| Construct a ReserveDestination object. | This does NOT reserve an address yet |
sourcepub fn get_reserved_destination(
&mut self,
pubkey: &mut TxDestination,
internal: bool,
error: &mut BilingualStr
) -> bool
pub fn get_reserved_destination( &mut self, pubkey: &mut TxDestination, internal: bool, error: &mut BilingualStr ) -> bool
| Reserve an address |
sourcepub fn return_destination(&mut self)
pub fn return_destination(&mut self)
| Return reserved address |
sourcepub fn keep_destination(&mut self)
pub fn keep_destination(&mut self)
| Keep the address. Do not return it’s | key to the keypool when this object goes | out of scope |