Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 675 Lines • ▼ Show 20 Lines | private: | ||||
* private, but it is marked private anyway to encourage use of the other | * private, but it is marked private anyway to encourage use of the other | ||||
* AddWatchOnly which accepts a timestamp and sets nTimeFirstKey more | * AddWatchOnly which accepts a timestamp and sets nTimeFirstKey more | ||||
* intelligently for more efficient rescans. | * intelligently for more efficient rescans. | ||||
*/ | */ | ||||
bool AddWatchOnly(const CScript &dest) override; | bool AddWatchOnly(const CScript &dest) override; | ||||
std::unique_ptr<CWalletDBWrapper> dbw; | std::unique_ptr<CWalletDBWrapper> dbw; | ||||
/** | |||||
* The following is used to keep track of how far behind the wallet is | |||||
* from the chain sync, and to allow clients to block on us being caught up. | |||||
* | |||||
* Note that this is *not* how far we've processed, we may need some rescan | |||||
* to have seen all transactions in the chain, but is only used to track | |||||
* live BlockConnected callbacks. | |||||
* | |||||
* Protected by cs_main (see BlockUntilSyncedToCurrentChain) | |||||
*/ | |||||
const CBlockIndex *m_last_block_processed; | |||||
public: | public: | ||||
const CChainParams &chainParams; | const CChainParams &chainParams; | ||||
/* | /* | ||||
* Main wallet lock. | * Main wallet lock. | ||||
* This lock protects all the fields added by CWallet. | * This lock protects all the fields added by CWallet. | ||||
*/ | */ | ||||
mutable CCriticalSection cs_wallet; | mutable CCriticalSection cs_wallet; | ||||
▲ Show 20 Lines • Show All 435 Lines • ▼ Show 20 Lines | public: | ||||
/** | /** | ||||
* Set the current HD master key (will reset the chain child index counters) | * Set the current HD master key (will reset the chain child index counters) | ||||
* If possibleOldChain is provided, the parameters from the old chain | * If possibleOldChain is provided, the parameters from the old chain | ||||
* (version) will be preserved. | * (version) will be preserved. | ||||
*/ | */ | ||||
bool SetHDMasterKey(const CPubKey &key, | bool SetHDMasterKey(const CPubKey &key, | ||||
CHDChain *possibleOldChain = nullptr); | CHDChain *possibleOldChain = nullptr); | ||||
/** | |||||
* Blocks until the wallet state is up-to-date to /at least/ the current | |||||
* chain at the time this function is entered. | |||||
* Obviously holding cs_main/cs_wallet when going into this call may cause | |||||
* deadlock | |||||
*/ | |||||
void BlockUntilSyncedToCurrentChain(); | |||||
}; | }; | ||||
/** A key allocated from the key pool. */ | /** A key allocated from the key pool. */ | ||||
class CReserveKey final : public CReserveScript { | class CReserveKey final : public CReserveScript { | ||||
protected: | protected: | ||||
CWallet *pwallet; | CWallet *pwallet; | ||||
int64_t nIndex; | int64_t nIndex; | ||||
CPubKey vchPubKey; | CPubKey vchPubKey; | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |