Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show All 25 Lines | |||||
#include <cstdint> | #include <cstdint> | ||||
#include <map> | #include <map> | ||||
#include <set> | #include <set> | ||||
#include <stdexcept> | #include <stdexcept> | ||||
#include <string> | #include <string> | ||||
#include <utility> | #include <utility> | ||||
#include <vector> | #include <vector> | ||||
typedef CWallet *CWalletRef; | extern std::vector<CWallet *> vpwallets; | ||||
extern std::vector<CWalletRef> vpwallets; | |||||
static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000; | static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000; | ||||
//! -paytxfee default | //! -paytxfee default | ||||
constexpr Amount DEFAULT_PAY_TX_FEE = Amount::zero(); | constexpr Amount DEFAULT_PAY_TX_FEE = Amount::zero(); | ||||
//! -fallbackfee default | //! -fallbackfee default | ||||
static const Amount DEFAULT_FALLBACK_FEE(20000 * SATOSHI); | static const Amount DEFAULT_FALLBACK_FEE(20000 * SATOSHI); | ||||
//! -mintxfee default | //! -mintxfee default | ||||
static const Amount DEFAULT_TRANSACTION_MINFEE_PER_KB = 1000 * SATOSHI; | static const Amount DEFAULT_TRANSACTION_MINFEE_PER_KB = 1000 * SATOSHI; | ||||
▲ Show 20 Lines • Show All 1,299 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Get all destinations (potentially) supported by the wallet for the given key. | * Get all destinations (potentially) supported by the wallet for the given key. | ||||
*/ | */ | ||||
std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey &key); | std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey &key); | ||||
/** RAII object to check and reserve a wallet rescan */ | /** RAII object to check and reserve a wallet rescan */ | ||||
class WalletRescanReserver { | class WalletRescanReserver { | ||||
private: | private: | ||||
CWalletRef m_wallet; | CWallet *m_wallet; | ||||
bool m_could_reserve; | bool m_could_reserve; | ||||
public: | public: | ||||
explicit WalletRescanReserver(CWalletRef w) | explicit WalletRescanReserver(CWallet *w) | ||||
: m_wallet(w), m_could_reserve(false) {} | : m_wallet(w), m_could_reserve(false) {} | ||||
bool reserve() { | bool reserve() { | ||||
assert(!m_could_reserve); | assert(!m_could_reserve); | ||||
std::lock_guard<std::mutex> lock(m_wallet->mutexScanning); | std::lock_guard<std::mutex> lock(m_wallet->mutexScanning); | ||||
if (m_wallet->fScanningWallet) { | if (m_wallet->fScanningWallet) { | ||||
return false; | return false; | ||||
} | } | ||||
Show All 28 Lines |