diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-02-16 14:22:18 +0100 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2018-07-12 10:30:21 +0100 |
commit | 9995a602a639b64a749545b7c3bafbf67f97324f (patch) | |
tree | 2fd0c1cf77980214e7190642c842d1603f0ee530 /src/wallet/wallet.cpp | |
parent | 5ba77df15de92deb35bfd501d4635aed3236af30 (diff) |
Add facility to store wallet flags (64 bits)
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index cdba6c6441..48ace544c4 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1526,6 +1526,28 @@ bool CWallet::IsHDEnabled() const return !hdChain.seed_id.IsNull(); } +void CWallet::SetWalletFlag(uint64_t flags) +{ + LOCK(cs_wallet); + m_wallet_flags |= flags; + if (!WalletBatch(*database).WriteWalletFlags(m_wallet_flags)) + throw std::runtime_error(std::string(__func__) + ": writing wallet flags failed"); +} + +bool CWallet::IsWalletFlagSet(uint64_t flag) +{ + return (m_wallet_flags & flag); +} + +void CWallet::SetWalletFlags(uint64_t overwriteFlags, bool memonly) +{ + LOCK(cs_wallet); + m_wallet_flags = overwriteFlags; + if (!memonly && !WalletBatch(*database).WriteWalletFlags(m_wallet_flags)) { + throw std::runtime_error(std::string(__func__) + ": writing wallet flags failed"); + } +} + int64_t CWalletTx::GetTxTime() const { int64_t n = nTimeSmart; |