6 #ifndef BITCOIN_WALLET_WALLET_H 7 #define BITCOIN_WALLET_WALLET_H 38 #include <boost/signals2/signal.hpp> 47 bool AddWallet(
const std::shared_ptr<CWallet>& wallet);
48 bool RemoveWallet(
const std::shared_ptr<CWallet>& wallet);
50 std::vector<std::shared_ptr<CWallet>>
GetWallets();
235 template <
typename Stream,
typename Operation>
237 int nVersion = s.GetVersion();
242 if (ser_action.ForRead()) {
246 catch (std::ios_base::failure&) {
254 catch (std::ios_base::failure&) {
345 if (!mapValue.count(
"n"))
350 nOrderPos =
atoi64(mapValue[
"n"].c_str());
358 mapValue[
"n"] =
i64tostr(nOrderPos);
394 SetTx(std::move(arg));
411 template <
typename Stream,
typename Operation>
413 std::vector<uint256> vMerkleBranch;
485 std::vector<std::pair<std::string, std::string> >
vOrderForm;
535 template<
typename Stream>
541 mapValueCopy[
"fromaccount"] =
"";
547 s << static_cast<const CMerkleTx&>(*
this);
548 std::vector<CMerkleTx> vUnused;
552 template<
typename Stream>
558 s >> static_cast<CMerkleTx&>(*
this);
559 std::vector<CMerkleTx> vUnused;
605 void GetAmounts(std::list<COutputEntry>& listReceived,
662 COutput(
const CWalletTx *txIn,
int iIn,
int nDepthIn,
bool fSpendableIn,
bool fSolvableIn,
bool fSafeIn,
bool use_max_sig_in =
false)
664 tx = txIn; i = iIn; nDepth = nDepthIn; fSpendable = fSpendableIn; fSolvable = fSolvableIn; fSafe = fSafeIn; nInputBytes = -1; use_max_sig = use_max_sig_in;
667 if (fSpendable &&
tx) {
668 nInputBytes =
tx->GetSpendSize(i, use_max_sig);
672 std::string ToString()
const;
695 template <
typename Stream,
typename Operation>
697 int nVersion = s.GetVersion();
710 size_t change_output_size = 0;
711 size_t change_spend_size = 0;
713 size_t tx_noinputs_size = 0;
715 CoinSelectionParams(
bool use_bnb,
size_t change_output_size,
size_t change_spend_size,
CFeeRate effective_fee,
size_t tx_noinputs_size) : use_bnb(use_bnb), change_output_size(change_output_size), change_spend_size(change_spend_size), effective_fee(effective_fee), tx_noinputs_size(tx_noinputs_size) {}
736 using CryptedKeyMap = std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char>>>;
745 bool Unlock(
const CKeyingMaterial& vMasterKeyIn,
bool accept_no_keys =
false);
750 bool AddCryptedKeyInner(
const CPubKey &vchPubKey,
const std::vector<unsigned char> &vchCryptedSecret);
753 std::atomic<bool> fAbortRescan{
false};
754 std::atomic<bool> fScanningWallet{
false};
755 std::atomic<int64_t> m_scanning_start{0};
756 std::atomic<double> m_scanning_progress{0};
770 bool fBroadcastTransactions =
false;
772 std::atomic<int64_t> m_best_block_time {0};
779 typedef std::multimap<COutPoint, uint256>
TxSpends;
837 bool AddWatchOnlyInMem(
const CScript &dest);
848 void AddKeypoolPubkeyWithDB(
const CPubKey& pubkey,
const bool internal,
WalletBatch& batch);
850 bool SetAddressBookWithDB(
WalletBatch& batch,
const CTxDestination& address,
const std::string& strName,
const std::string& strPurpose);
878 bool GetKeyFromPool(
CPubKey &
key,
bool internal =
false);
900 bool SelectCoins(
const std::vector<COutput>& vAvailableCoins,
const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet,
CAmount& nValueRet,
920 unsigned int nMasterKeyMaxID = 0;
925 fDecryptionThoroughlyChecked(false),
927 m_location(location),
928 database(std::move(database))
936 delete encrypted_batch;
937 encrypted_batch =
nullptr;
941 bool IsLocked()
const;
944 std::map<uint256, CWalletTx> mapWallet
GUARDED_BY(cs_wallet);
946 typedef std::multimap<int64_t, CWalletTx*>
TxItems;
952 std::map<CTxDestination, CAddressBookData> mapAddressBook
GUARDED_BY(cs_wallet);
954 std::set<COutPoint> setLockedCoins
GUARDED_BY(cs_wallet);
960 void handleNotifications();
998 bool IsUsedDestination(const
uint256& hash,
unsigned int n) const;
999 void SetUsedDestinationState(const
uint256& hash,
unsigned int n,
bool used);
1001 std::vector<
OutputGroup> GroupOutputs(const std::vector<
COutput>& outputs,
bool single_coin) const;
1012 void AbortRescan() { fAbortRescan =
true; }
1037 bool AddCryptedKey(
const CPubKey &vchPubKey,
const std::vector<unsigned char> &vchCryptedSecret);
1039 bool LoadCryptedKey(
const CPubKey &vchPubKey,
const std::vector<unsigned char> &vchCryptedSecret);
1040 bool GetKey(
const CKeyID &address,
CKey& keyOut)
const override;
1043 std::set<CKeyID> GetKeys()
const override;
1044 bool AddCScript(
const CScript& redeemScript)
override;
1045 bool LoadCScript(
const CScript& redeemScript);
1062 bool LoadWatchOnly(
const CScript &dest);
1064 bool HaveWatchOnly(
const CScript &dest)
const;
1066 bool HaveWatchOnly()
const;
1068 bool GetWatchPubKey(
const CKeyID &address,
CPubKey &pubkey_out)
const;
1073 bool Unlock(
const SecureString& strWalletPassphrase,
bool accept_no_keys =
false);
1074 bool ChangeWalletPassphrase(
const SecureString& strOldWalletPassphrase,
const SecureString& strNewWalletPassphrase);
1075 bool EncryptWallet(
const SecureString& strWalletPassphrase);
1078 unsigned int ComputeTimeSmart(
const CWalletTx& wtx)
const;
1088 bool AddToWallet(const
CWalletTx& wtxIn,
bool fFlushOnClose=true);
1091 void BlockConnected(const
CBlock& block, const std::vector<
CTransactionRef>& vtxConflicted) override;
1092 void BlockDisconnected(const
CBlock& block) override;
1093 void UpdatedBlockTip() override;
1112 void TransactionRemovedFromMempool(
const CTransactionRef &ptx)
override;
1114 void ResendWalletTransactions();
1123 Balance GetBalance(
int min_depth = 0,
bool avoid_reuse =
true)
const;
1126 OutputType TransactionChangeType(
OutputType change_type,
const std::vector<CRecipient>& vecSend);
1141 std::string& strFailReason,
const CCoinControl& coin_control,
bool sign =
true);
1146 std::vector<CTxOut> v_txouts(txouts.size());
1147 std::copy(txouts.begin(), txouts.end(), v_txouts.begin());
1148 return DummySignTx(txNew, v_txouts, use_max_sig);
1150 bool DummySignTx(
CMutableTransaction &txNew,
const std::vector<CTxOut> &txouts,
bool use_max_sig =
false)
const;
1151 bool DummySignInput(
CTxIn &tx_in,
const CTxOut &txout,
bool use_max_sig =
false)
const;
1155 bool ImportPubKeys(
const std::vector<CKeyID>& ordered_pubkeys,
const std::map<CKeyID, CPubKey>& pubkey_map,
const std::map<
CKeyID, std::pair<CPubKey, KeyOriginInfo>>& key_origins,
const bool add_keypool,
const bool internal,
const int64_t timestamp)
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
1156 bool ImportScriptPubKeys(
const std::string& label,
const std::set<CScript>& script_pub_keys,
const bool have_solving_data,
const bool internal,
const int64_t timestamp)
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
1162 bool m_allow_fallback_fee{
true};
1178 bool TopUpKeyPool(
unsigned int kpSize = 0);
1197 int64_t GetOldestKeyPoolTime();
1202 const std::map<
CKeyID,
int64_t>& GetAllReserveKeys()
const {
return m_pool_key_to_index; }
1207 std::set<
CTxDestination> GetLabelAddresses(const std::
string& label) const;
1220 bool IsChange(const
CTxOut& txout) const;
1221 bool IsChange(const
CScript& script) const;
1237 bool SetAddressBook(const
CTxDestination& address, const std::
string& strName, const std::
string& purpose);
1246 return setInternalKeyPool.size() + setExternalKeyPool.size();
1253 bool SetMaxVersion(
int nVersion);
1265 void Flush(
bool shutdown=
false);
1275 &address,
const std::string &label,
bool isMine,
1276 const std::string &purpose,
1283 boost::signals2::signal<void (
CWallet *wallet,
const uint256 &hashTx,
1287 boost::signals2::signal<void (
const std::string &title,
int nProgress)>
ShowProgress;
1307 bool TransactionCanBeAbandoned(
const uint256& hashTx)
const;
1316 static bool Verify(
interfaces::Chain& chain,
const WalletLocation& location,
bool salvage_wallet, std::string& error_string, std::string& warning_string);
1325 void postInitProcess();
1327 bool BackupWallet(
const std::string& strDest);
1330 void SetHDChain(
const CHDChain& chain,
bool memonly);
1334 bool IsHDEnabled()
const;
1337 bool CanGenerateKeys();
1340 bool CanGetAddresses(
bool internal =
false);
1374 void LearnAllRelatedScripts(const
CPubKey&
key);
1380 void UnsetWalletFlag(
uint64_t flag);
1383 bool IsWalletFlagSet(
uint64_t flag) const;
1387 bool SetWalletFlags(
uint64_t overwriteFlags,
bool memOnly);
1390 const std::
string GetDisplayName()
const {
1391 std::string wallet_name = GetName().length() == 0 ?
"default wallet" : GetName();
1396 template<
typename...
Params>
1398 LogPrintf((
"%s " + fmt).c_str(), GetDisplayName(), parameters...);
1422 assert(!m_could_reserve);
1430 m_could_reserve =
true;
1442 if (m_could_reserve) {
1454 #endif // BITCOIN_WALLET_WALLET_H std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:408
ReserveDestination & operator=(const ReserveDestination &)=delete
CoinSelectionParams(bool use_bnb, size_t change_output_size, size_t change_spend_size, CFeeRate effective_fee, size_t tx_noinputs_size)
Definition: wallet.h:715
#define EXCLUSIVE_LOCKS_REQUIRED(...)
Definition: thread_annotations.h:13
boost::signals2::signal< void()> NotifyCanGetAddressesChanged
Definition: wallet.h:1293
newHash
Definition: optimize-pngs.py:71
Definition: signingprovider.h:63
CachableAmount m_amounts[AMOUNTTYPE_ENUM_ELEMENTS]
Definition: wallet.h:510
boost::signals2::signal< void(bool fHaveWatchOnly)> NotifyWatchonlyChanged
Definition: wallet.h:1290
Definition: transaction.h:366
bool isAbandoned() const
Definition: wallet.h:438
bool AcceptToMemoryPool(interfaces::Chain::Lock &locked_chain, CValidationState &state)
Definition: wallet.cpp:4646
int64_t nTimeExpires
Definition: wallet.h:686
const CWalletTx * tx
Definition: wallet.h:639
std::multimap< int64_t, CWalletTx * > TxItems
Definition: wallet.h:946
Definition: walletdb.h:152
CAmount nAmount
Definition: wallet.h:336
Definition: transaction.h:63
int64_t nTime
The time at which the key was generated. Set in AddKeypoolPubKeyWithDB.
Definition: wallet.h:222
std::map< std::string, std::string > mapValue_t
Definition: wallet.h:340
CAmount GetImmatureWatchOnlyCredit(interfaces::Chain::Lock &locked_chain, const bool fUseCache=true) const
Definition: wallet.cpp:2254
bool fSpendable
Definition: wallet.h:647
void SetBroadcastTransactions(bool broadcast)
Definition: wallet.h:1304
constexpr CAmount DEFAULT_TRANSACTION_MAXFEE
-maxtxfee default
Definition: wallet.h:87
bool IsCoinBase() const
Definition: wallet.h:442
char fFromMe
Definition: wallet.h:503
constexpr CAmount HIGH_MAX_TX_FEE
-maxtxfee will warn if called with a higher fee than this amount (in satoshis)
Definition: wallet.h:91
bool fSubtractFeeFromAmount
Definition: wallet.h:337
void ReturnDestination()
Return reserved address.
Definition: wallet.cpp:3924
AmountType
Definition: wallet.h:508
void SetTx(CTransactionRef arg)
Definition: wallet.h:404
TxItems wtxOrdered
Definition: wallet.h:947
bool m_pre_split
Whether this key was generated for a keypool before the wallet was upgraded to HD-split.
Definition: wallet.h:228
constexpr CAmount DEFAULT_PAY_TX_FEE
-paytxfee default
Definition: wallet.h:65
int64_t GetTimeMillis()
Definition: time.cpp:54
static const CAmount MAX_MONEY
Definition: amount.h:25
CPubKey vchPubKey
The public key.
Definition: wallet.h:224
bool IsTrusted(interfaces::Chain::Lock &locked_chain) const
Definition: wallet.cpp:2277
WalletLocation m_location
Definition: wallet.h:862
bool IsFromMe(const isminefilter &filter) const
Definition: wallet.h:608
int nIndex
Definition: wallet.h:384
CWallet * m_wallet
Definition: wallet.h:1415
constexpr OutputType DEFAULT_CHANGE_TYPE
Default for -changetype.
Definition: wallet.h:127
CCriticalSection cs_wallet
Definition: wallet.h:885
static const CAmount COIN
Definition: amount.h:14
bool AddWallet(const std::shared_ptr< CWallet > &wallet)
Definition: wallet.cpp:52
FeeEstimateMode
Definition: fees.h:49
const char * prefix
Definition: rest.cpp:626
bool fInternal
Whether this keypool entry is in the internal keypool (for change outputs)
Definition: wallet.h:226
const WalletLocation & GetLocation() const
Definition: wallet.h:903
static CTransactionRef MakeTransactionRef()
Definition: transaction.h:409
std::map< std::string, std::string > StringMap
Definition: wallet.h:329
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
Definition: secure.h:60
int GetDepthInMainChain(interfaces::Chain::Lock &locked_chain) const
Definition: wallet.cpp:4623
CTxDestination address
The destination.
Definition: wallet.h:292
std::shared_ptr< CWallet > LoadWallet(interfaces::Chain &chain, const WalletLocation &location, std::string &error, std::string &warning)
Definition: wallet.cpp:141
bool CanSupportFeature(enum WalletFeature wf) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
check whether we are allowed to upgrade (or already support) to the named feature
Definition: wallet.h:968
const std::string & GetName() const
Definition: wallet.h:907
mapValue_t mapValue
Definition: wallet.h:484
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
Definition: crypter.h:68
ADD_SERIALIZE_METHODS
Definition: wallet.h:233
static void ReadOrderPos(int64_t &nOrderPos, mapValue_t &mapValue)
Definition: wallet.h:343
static const uint256 ABANDON_HASH
Definition: wallet.h:373
static void LogPrintf(const char *fmt, const Args &... args)
Definition: logging.h:144
std::map< unsigned int, CMasterKey > MasterKeyMap
Definition: wallet.h:918
CAmount nChangeCached
Definition: wallet.h:513
Chain notifications.
Definition: chain.h:228
const std::map< uint64_t, std::string > WALLET_FLAG_CAVEATS
Definition: wallet.cpp:39
static const bool DEFAULT_DISABLE_WALLET
Definition: wallet.h:85
WalletFeature
Definition: wallet.h:105
bool GetBroadcastTransactions() const
Definition: wallet.h:1302
int64_t nIndex
The index of the address's key in the keypool.
Definition: wallet.h:288
int GetSpendSize(unsigned int out, bool use_max_sig=false) const
Definition: wallet.h:600
UniValue SignTransaction(CMutableTransaction &mtx, const UniValue &prevTxsUnival, FillableSigningProvider *keystore, std::map< COutPoint, Coin > &coins, bool is_temp_keystore, const UniValue &hashType)
Definition: rawtransaction_util.cpp:152
StringMap destdata
Definition: wallet.h:330
void SetMerkleBranch(const uint256 &block_hash, int posInBlock)
Definition: wallet.cpp:4614
std::string name
Definition: wallet.h:324
Definition: walletdb.h:59
CMerkleTx()
Definition: wallet.h:386
ADD_SERIALIZE_METHODS
Definition: wallet.h:409
void UnloadWallet(std::shared_ptr< CWallet > &&wallet)
Definition: wallet.cpp:118
WalletCreationStatus
Definition: wallet.h:54
Definition: validation.h:98
void KeepDestination()
Keep the address. Do not return it's key to the keypool when this object goes out of scope.
Definition: wallet.cpp:3915
DBErrors
Definition: walletdb.h:48
bool IsImmatureCoinBase(interfaces::Chain::Lock &locked_chain) const
Definition: wallet.cpp:4640
const std::string & GetName() const
Get wallet name.
Definition: walletutil.h:29
bool IsNull() const
Definition: uint256.h:31
OutputType
Definition: outputtype.h:16
static const bool DEFAULT_WALLET_RBF
-walletrbf default
Definition: wallet.h:83
interfaces::Chain & chain() const
Definition: wallet.h:963
bool reserve()
Definition: wallet.h:1420
COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn, bool fSolvableIn, bool fSafeIn, bool use_max_sig_in=false)
Definition: wallet.h:662
unsigned int nTimeReceived
time received by this node
Definition: wallet.h:487
CAmount GetChange() const
Definition: wallet.cpp:2263
Definition: coincontrol.h:16
bool DummySignTx(CMutableTransaction &txNew, const std::set< CTxOut > &txouts, bool use_max_sig=false) const
Definition: wallet.h:1144
boost::signals2::signal< void(CWallet *wallet, const uint256 &hashTx, ChangeType status)> NotifyTransactionChanged
Definition: wallet.h:1284
bool HaveKey(const CWallet &wallet, const CKey &key)
Definition: rpcwallet.cpp:56
int GetVersion()
get the current wallet format (the oldest client version guaranteed to understand this wallet)
Definition: wallet.h:1256
int64_t CAmount
Definition: amount.h:12
static const CAmount DEFAULT_FALLBACK_FEE
-fallbackfee default
Definition: wallet.h:67
std::vector< unsigned char, secure_allocator< unsigned char > > CPrivKey
Definition: key.h:24
int vout
Definition: wallet.h:365
void Reset()
Definition: ismine.h:42
int nDepth
Definition: wallet.h:641
static const std::map< std::string, WalletFlags > WALLET_FLAG_MAP
Definition: wallet.h:165
CoinSelectionParams()
Definition: wallet.h:716
boost::signals2::signal< void(CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, const std::string &purpose, ChangeType status)> NotifyAddressBookChanged
Definition: wallet.h:1277
double ScanningProgress() const
Definition: wallet.h:1016
std::atomic< double > m_scanning_progress
Definition: wallet.h:756
void SerializationOp(Stream &s, Operation ser_action)
Definition: wallet.h:412
~WalletRescanReserver()
Definition: wallet.h:1439
int GetBlocksToMaturity(interfaces::Chain::Lock &locked_chain) const
Definition: wallet.cpp:4631
Definition: serialize.h:177
std::shared_ptr< CWallet > CreateWallet(interfaces::Chain &chain, const std::string &name, std::string &error, std::string &warning, WalletCreationStatus &status, const SecureString &passphrase, uint64_t wallet_creation_flags)
Definition: wallet.cpp:163
bool hashUnset() const
Definition: wallet.h:437
ChangeType
Definition: ui_interface.h:26
std::atomic< bool > fScanningWallet
Definition: wallet.h:754
bool m_could_reserve
Definition: wallet.h:1416
Definition: dummywallet.cpp:11
std::atomic< bool > fUseCrypto
Definition: wallet.h:731
Definition: transaction.h:270
Definition: transaction.h:18
#define LOCK(cs)
Definition: sync.h:182
const char * name
Definition: rest.cpp:39
~CWallet()
Definition: wallet.h:932
std::atomic< int64_t > m_scanning_start
Definition: wallet.h:755
int nWalletVersion GUARDED_BY(cs_wallet)
the current wallet version: clients below this version are not able to load the wallet
Definition: wallet.h:763
void Serialize(Stream &s) const
Definition: wallet.h:536
int64_t GetTxTime() const
Definition: wallet.cpp:1742
limitedmap< uint256, int64_t > g_already_asked_for GUARDED_BY() cs_main(MAX_INV_SZ)
std::string purpose
Definition: wallet.h:325
unsigned long long uint64_t
Definition: stdint.h:22
CWallet * pwallet
The wallet to reserve from.
Definition: wallet.h:286
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
Definition: wallet.h:1287
bool fInMempool
Definition: wallet.h:512
void WalletLogPrintf(std::string fmt, Params... parameters) const
Definition: wallet.h:1397
std::string i64tostr(int64_t n)
Definition: strencodings.cpp:397
CAddressBookData()
Definition: wallet.h:327
static const bool DEFAULT_WALLETBROADCAST
Definition: wallet.h:84
bool GetReservedDestination(const OutputType type, CTxDestination &pubkey, bool internal)
Reserve an address.
Definition: wallet.cpp:3893
bool fSafe
Definition: wallet.h:660
unsigned int nTimeSmart
Definition: wallet.h:497
~ReserveDestination()
Destructor. If a key has been reserved and not KeepKey'ed, it will be returned to the keypool.
Definition: wallet.h:307
uint8_t isminefilter
Definition: wallet.h:28
Definition: wallet.h:1115
boost::signals2::signal< void()> NotifyUnload
Definition: wallet.h:1268
bool IsInMainChain(interfaces::Chain::Lock &locked_chain) const
Definition: wallet.h:429
CInputCoin GetInputCoin() const
Definition: wallet.h:674
const CHDChain & GetHDChain() const
Definition: wallet.h:1331
void setAbandoned()
Definition: wallet.h:439
static const bool DEFAULT_SPEND_ZEROCONF_CHANGE
Default for -spendzeroconfchange.
Definition: wallet.h:75
constexpr OutputType DEFAULT_ADDRESS_TYPE
Default for -addresstype.
Definition: wallet.h:124
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
Definition: wallet.cpp:2177
isminetype
Definition: ismine.h:18
std::vector< std::pair< std::string, std::string > > vOrderForm
Definition: wallet.h:485
bool fInternal
Whether this is from the internal (change output) keypool.
Definition: wallet.h:294
void GetAmounts(std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, const isminefilter &filter) const
Definition: wallet.cpp:1892
std::shared_ptr< CWallet > GetWallet(const std::string &name)
Definition: wallet.cpp:84
static const bool DEFAULT_AVOIDPARTIALSPENDS
Default for -avoidpartialspends.
Definition: wallet.h:79
std::string strComment
Definition: wallet.h:687
static const unsigned int DEFAULT_TX_CONFIRM_TARGET
-txconfirmtarget default
Definition: wallet.h:81
bool IsEquivalentTo(const CWalletTx &tx) const
Definition: wallet.cpp:2309
bool isReserved() const
Definition: wallet.h:1434
std::unique_ptr< interfaces::Handler > m_chain_notifications_handler
Definition: wallet.h:957
#define LOCKS_EXCLUDED(...)
Definition: thread_annotations.h:21
CMerkleTx(CTransactionRef arg)
Definition: wallet.h:392
bool RelayWalletTransaction(interfaces::Chain::Lock &locked_chain)
Definition: wallet.cpp:2133
interfaces::Chain * m_chain
Definition: wallet.h:859
bool HasWallets()
Definition: wallet.cpp:72
std::set< uint256 > GetConflicts() const NO_THREAD_SAFETY_ANALYSIS
Definition: wallet.cpp:2156
int64_t nOrderPos
position in ordered transaction list
Definition: wallet.h:504
isminetype IsMine(const CWallet &keystore, const CScript &scriptPubKey)
Definition: ismine.cpp:175
static constexpr uint64_t MUTABLE_WALLET_FLAGS
Definition: wallet.h:162
bool RemoveWallet(const std::shared_ptr< CWallet > &wallet)
Definition: wallet.cpp:62
int flags
Definition: bitcoin-tx.cpp:507
Definition: keyorigin.h:12
WalletRescanReserver(CWallet *w)
Definition: wallet.h:1418
static const bool DEFAULT_WALLET_REJECT_LONG_CHAINS
Default for -walletrejectlongchains.
Definition: wallet.h:77
#define NO_THREAD_SAFETY_ANALYSIS
Definition: thread_annotations.h:57
static void NotifyUnload(WalletModel *walletModel)
Definition: walletmodel.cpp:377
Definition: uint256.h:121
void Init(const CWallet *pwalletIn)
Definition: wallet.h:520
CAmount GetCachableAmount(AmountType type, const isminefilter &filter, bool recalculate=false) const
Definition: wallet.cpp:2168
int64_t atoi64(const char *psz)
Definition: strencodings.cpp:407
Definition: coinselection.h:67
static const CAmount DEFAULT_TRANSACTION_MINFEE
-mintxfee default
Definition: wallet.h:71
void Unserialize(Stream &s)
Definition: wallet.h:553
void Init()
Definition: wallet.h:398
static void WriteOrderPos(const int64_t &nOrderPos, mapValue_t &mapValue)
Definition: wallet.h:354
void SerializationOp(Stream &s, Operation ser_action)
Definition: wallet.h:236
void MarkDirty()
make sure balances are recalculated
Definition: wallet.h:572
std::mutex mutexScanning
Definition: wallet.h:757
The WalletLocation class provides wallet information.
Definition: walletutil.h:19
Result CommitTransaction(CWallet *wallet, const uint256 &txid, CMutableTransaction &&mtx, std::vector< std::string > &errors, uint256 &bumped_txid)
Definition: feebumper.cpp:308
CWalletTx(const CWallet *pwalletIn, CTransactionRef arg)
Definition: wallet.h:515
const CChainParams & Params()
Definition: chainparams.cpp:399
std::unique_ptr< WalletDatabase > database
Definition: wallet.h:865
static bool GetPubKey(const SigningProvider &provider, const SignatureData &sigdata, const CKeyID &address, CPubKey &pubkey)
Definition: sign.cpp:52
std::set< CScript > WatchOnlySet
Definition: wallet.h:737
const CWallet * pwallet
Definition: wallet.h:456
Definition: standard.h:22
bool fChangeCached
Definition: wallet.h:511
int i
Definition: wallet.h:640
#define LIMITED_STRING(obj, n)
Definition: serialize.h:424
std::map< CKeyID, CPubKey > WatchKeyMap
Definition: wallet.h:738
int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *wallet, bool use_max_sig=false) EXCLUSIVE_LOCKS_REQUIRED(wallet -> cs_wallet)
Definition: wallet.cpp:1853
unsigned int fTimeReceivedIsTxTime
Definition: wallet.h:486
int nInputBytes
Definition: wallet.h:644
void MaybeResendWalletTxs()
Definition: wallet.cpp:2367
CScript scriptPubKey
Definition: wallet.h:335
#define GUARDED_BY(x)
Definition: threadsafety.h:38
void FundTransaction(CWallet *const pwallet, CMutableTransaction &tx, CAmount &fee_out, int &change_position, UniValue options)
Definition: rpcwallet.cpp:2960
bool use_max_sig
Definition: wallet.h:653
bool fDecryptionThoroughlyChecked
keeps track of whether Unlock has run a thorough check before
Definition: wallet.h:734
signed long long int64_t
Definition: stdint.h:18
CTxDestination destination
Definition: wallet.h:363
bool IsAbortingRescan()
Definition: wallet.h:1013
int CalculateMaximumSignedInputSize(const CTxOut &txout, const CWallet *pwallet, bool use_max_sig=false)
Definition: wallet.cpp:1882
WalletFlags
Definition: wallet.h:129
list warning
Definition: security-check.py:199
static const CAmount WALLET_INCREMENTAL_RELAY_FEE
minimum recommended increment for BIP 125 replacement txs
Definition: wallet.h:73
CPubKey vchPubKey
The public key for the address.
Definition: wallet.h:290
WalletDatabase & GetDBHandle()
Definition: wallet.h:890
CAmount amount
Definition: wallet.h:364
CKeyPool()
Definition: wallet.cpp:4593
boost::optional< T > Optional
Substitute for C++17 std::optional.
Definition: optional.h:14
CPrivKey vchPrivKey
Definition: wallet.h:684
void BindWallet(CWallet *pwalletIn)
Definition: wallet.h:581
static const unsigned int DEFAULT_KEYPOOL_SIZE
Default for -keypool.
Definition: wallet.h:63
ADD_SERIALIZE_METHODS
Definition: wallet.h:693
boost::variant< CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown > CTxDestination
Definition: standard.h:139
boost::signals2::signal< void(CWallet *wallet)> NotifyStatusChanged
Definition: wallet.h:1299
AssertLockHeld(g_cs_orphans)
#define READWRITE(...)
Definition: serialize.h:184
int64_t ScanningDuration() const
Definition: wallet.h:1015
CAmount GetCredit(interfaces::Chain::Lock &locked_chain, const isminefilter &filter) const
Definition: wallet.cpp:2192
uint256 last_scanned_block
Definition: wallet.h:1102
std::multimap< COutPoint, uint256 > TxSpends
Definition: wallet.h:779
int64_t nTimeCreated
Definition: wallet.h:685
CAmount GetAvailableCredit(interfaces::Chain::Lock &locked_chain, bool fUseCache=true, const isminefilter &filter=ISMINE_SPENDABLE) const NO_THREAD_SAFETY_ANALYSIS
Definition: wallet.cpp:2218
const uint256 & GetHash() const
Definition: wallet.h:441
Definition: coinselection.h:56
Optional< int > last_scanned_height
Definition: wallet.h:1103
bool error(const char *fmt, const Args &... args)
Definition: system.h:59
ReserveDestination(CWallet *pwalletIn)
Construct a ReserveDestination object. This does NOT reserve an address yet.
Definition: wallet.h:298
uint256 last_failed_block
Definition: wallet.h:1109
Definition: wallet.h:1412
bool IsCrypted() const
Definition: wallet.h:940
static const CAmount DEFAULT_DISCARD_FEE
-discardfee default
Definition: wallet.h:69
uint256 hashBlock
Definition: wallet.h:377
bool IsScanning()
Definition: wallet.h:1014
std::multimap< int64_t, CWalletTx * >::const_iterator m_it_wtxOrdered
Definition: wallet.h:505
void SerializationOp(Stream &s, Operation ser_action)
Definition: wallet.h:696
bool InMempool() const
Definition: wallet.cpp:2272
CAmount GetImmatureCredit(interfaces::Chain::Lock &locked_chain, bool fUseCache=true) const
Definition: wallet.cpp:2209
bool fSolvable
Definition: wallet.h:650
std::vector< std::shared_ptr< CWallet > > GetWallets()
Definition: dummywallet.cpp:67
std::map< CKeyID, std::pair< CPubKey, std::vector< unsigned char > >> CryptedKeyMap
Definition: wallet.h:736
static constexpr uint64_t KNOWN_WALLET_FLAGS
Definition: wallet.h:156
CTransactionRef tx
Definition: wallet.h:376
constexpr CAmount HIGH_TX_FEE_PER_KB
Discourage users to set fees higher than this amount (in satoshis) per kB.
Definition: wallet.h:89
Definition: wallet.h:1096
def sign()
Definition: gitian-build.py:91
Definition: transaction.h:133
static constexpr size_t DUMMY_NESTED_P2WPKH_INPUT_SIZE
Pre-calculated constants for input size estimation in virtual size
Definition: wallet.h:94