aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-04-17 18:22:23 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-04-18 22:07:33 +0100
commit373aee26c3df233f4e0a7e806f45ac7cb5aab1e6 (patch)
tree9594af3ef3b909ff0c70bb73917785b460308d67 /src/wallet/wallet.h
parent6efd9644cfe31168db1841010cffa64dfe604e67 (diff)
downloadbitcoin-373aee26c3df233f4e0a7e806f45ac7cb5aab1e6.tar.xz
wallet: Add AddWallet, RemoveWallet, GetWallet and GetWallets
With these new functions all vpwallets usage are removed and vpwallets is now a static variable (no external linkage).
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index ceac4ac58c..67f0b3adb7 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -32,7 +32,10 @@
#include <utility>
#include <vector>
-extern std::vector<CWallet*> vpwallets;
+bool AddWallet(CWallet* wallet);
+bool RemoveWallet(CWallet* wallet);
+std::vector<CWallet*> GetWallets();
+CWallet* GetWallet(const std::string& name);
/**
* Settings
@@ -267,7 +270,7 @@ public:
//Get the marginal bytes of spending the specified output
int CalculateMaximumSignedInputSize(const CTxOut& txout, const CWallet* pwallet);
-/**
+/**
* A transaction with a bunch of additional info that only the owner cares about.
* It includes any unrecorded transactions needed to link it back to the block chain.
*/
@@ -652,7 +655,7 @@ struct CoinEligibilityFilter
};
class WalletRescanReserver; //forward declarations for ScanForWalletTransactions/RescanFromTime
-/**
+/**
* A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,
* and provides the ability to create new transactions.
*/
@@ -902,7 +905,7 @@ public:
void GetKeyBirthTimes(std::map<CTxDestination, int64_t> &mapKeyBirth) const;
unsigned int ComputeTimeSmart(const CWalletTx& wtx) const;
- /**
+ /**
* Increment the next transaction order id
* @return next transaction order id
*/
@@ -1031,7 +1034,7 @@ public:
}
void GetScriptForMining(std::shared_ptr<CReserveScript> &script);
-
+
unsigned int GetKeyPoolSize()
{
AssertLockHeld(cs_wallet); // set{Ex,In}ternalKeyPool
@@ -1056,7 +1059,7 @@ public:
//! Flush wallet (bitdb flush)
void Flush(bool shutdown=false);
- /**
+ /**
* Address book entry changed.
* @note called with lock cs_wallet held.
*/
@@ -1065,7 +1068,7 @@ public:
const std::string &purpose,
ChangeType status)> NotifyAddressBookChanged;
- /**
+ /**
* Wallet transaction added, removed or updated.
* @note called with lock cs_wallet held.
*/
@@ -1112,7 +1115,7 @@ public:
/* Generates a new HD master key (will not be activated) */
CPubKey GenerateNewHDMasterKey();
-
+
/* Set the current HD master key (will reset the chain child index counters)
Sets the master key's version based on the current wallet version (so the
caller must ensure the current wallet version is correct before calling
@@ -1183,7 +1186,7 @@ public:
};
-/**
+/**
* DEPRECATED Account information.
* Stored in wallet with key "acc"+string account name.
*/