Bitcoin ABC 0.26.3
P2P Digital Currency
|
A wrapper to reserve an address from a wallet. More...
#include <wallet.h>
Public Member Functions | |
ReserveDestination (CWallet *_pwallet, OutputType _type) | |
Construct a ReserveDestination object. | |
ReserveDestination (const ReserveDestination &)=delete | |
ReserveDestination & | operator= (const ReserveDestination &)=delete |
~ReserveDestination () | |
Destructor. | |
bool | GetReservedDestination (CTxDestination &pubkey, bool internal) |
Reserve an address. | |
void | ReturnDestination () |
Return reserved address. | |
void | KeepDestination () |
Keep the address. | |
Protected Attributes | |
const CWallet *const | pwallet |
The wallet to reserve from. | |
ScriptPubKeyMan * | m_spk_man {nullptr} |
The ScriptPubKeyMan to reserve from. | |
OutputType const | type |
int64_t | nIndex {-1} |
The index of the address's key in the keypool. | |
CTxDestination | address |
The destination. | |
bool | fInternal {false} |
Whether this is from the internal (change output) keypool. | |
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.
|
inlineexplicit |
Construct a ReserveDestination object.
This does NOT reserve an address yet
|
delete |
|
inline |
|
delete |
|
protected |
|
protected |
The ScriptPubKeyMan to reserve from.
Based on type when GetReservedDestination is called
|
protected |
|
protected |
|
protected |