6 #ifndef BITCOIN_WALLET_WALLET_H 7 #define BITCOIN_WALLET_WALLET_H 39 #include <boost/signals2/signal.hpp> 41 using LoadWalletFn = std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>;
52 bool AddWallet(
const std::shared_ptr<CWallet>& wallet);
55 std::vector<std::shared_ptr<CWallet>>
GetWallets();
201 const std::string&
GetLabel()
const {
return m_label; }
220 if (!mapValue.count(
"n"))
225 nOrderPos =
atoi64(mapValue[
"n"]);
233 mapValue[
"n"] =
ToString(nOrderPos);
251 template<
typename Stream>
256 std::vector<uint256> vMerkleBranch;
259 s >> tx >> hashBlock >> vMerkleBranch >>
nIndex;
307 std::vector<std::pair<std::string, std::string> >
vOrderForm;
339 mutable bool m_is_cache_empty{
true};
355 fTimeReceivedIsTxTime =
false;
359 fChangeCached =
false;
398 template<
typename Stream>
403 mapValueCopy[
"fromaccount"] =
"";
406 mapValueCopy[
"timesmart"] =
strprintf(
"%u", nTimeSmart);
409 std::vector<char> dummy_vector1;
410 std::vector<char> dummy_vector2;
411 bool dummy_bool =
false;
412 uint256 serializedHash = isAbandoned() ? ABANDON_HASH : m_confirm.
hashBlock;
413 int serializedIndex = isAbandoned() || isConflicted() ? -1 : m_confirm.
nIndex;
414 s << tx << serializedHash << dummy_vector1 << serializedIndex << dummy_vector2 << mapValueCopy << vOrderForm << fTimeReceivedIsTxTime << nTimeReceived << fFromMe << dummy_bool;
417 template<
typename Stream>
422 std::vector<uint256> dummy_vector1;
423 std::vector<CMerkleTx> dummy_vector2;
426 s >> tx >> m_confirm.
hashBlock >> dummy_vector1 >> serializedIndex >> dummy_vector2 >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> nTimeReceived >> fFromMe >> dummy_bool;
435 if (serializedIndex == -1 && m_confirm.
hashBlock == ABANDON_HASH) {
437 }
else if (serializedIndex == -1) {
440 m_confirm.
nIndex = serializedIndex;
445 nTimeSmart = mapValue.count(
"timesmart") ? (
unsigned int)
atoi64(mapValue[
"timesmart"]) : 0;
447 mapValue.erase(
"fromaccount");
448 mapValue.erase(
"spent");
450 mapValue.erase(
"timesmart");
461 m_amounts[DEBIT].
Reset();
462 m_amounts[CREDIT].
Reset();
463 m_amounts[IMMATURE_CREDIT].
Reset();
464 m_amounts[AVAILABLE_CREDIT].
Reset();
465 fChangeCached =
false;
466 m_is_cache_empty =
true;
472 CAmount GetImmatureCredit(
bool fUseCache =
true)
const;
478 CAmount GetImmatureWatchOnlyCredit(
const bool fUseCache =
true)
const;
487 void GetAmounts(std::list<COutputEntry>& listReceived,
492 return (GetDebit(filter) > 0);
496 bool IsEquivalentTo(
const CWalletTx& tx)
const;
498 bool InMempool()
const;
499 bool IsTrusted()
const;
501 int64_t GetTxTime()
const;
504 bool SubmitMemoryPoolAndRelay(std::string& err_string,
bool relay);
534 int GetBlocksToMaturity()
const;
551 bool IsImmatureCoinBase()
const;
586 COutput(
const CWalletTx *txIn,
int iIn,
int nDepthIn,
bool fSpendableIn,
bool fSolvableIn,
bool fSafeIn,
bool use_max_sig_in =
false)
588 tx = txIn; i = iIn; nDepth = nDepthIn; fSpendable = fSpendableIn; fSolvable = fSolvableIn; fSafe = fSafeIn; nInputBytes = -1; use_max_sig = use_max_sig_in;
591 if (fSpendable && tx) {
607 size_t change_output_size = 0;
608 size_t change_spend_size = 0;
612 size_t tx_noinputs_size = 0;
614 bool m_subtract_fee_outputs =
false;
617 CFeeRate long_term_feerate,
CFeeRate discard_feerate,
size_t tx_noinputs_size) :
619 change_output_size(change_output_size),
620 change_spend_size(change_spend_size),
621 m_effective_feerate(effective_feerate),
622 m_long_term_feerate(long_term_feerate),
623 m_discard_feerate(discard_feerate),
624 tx_noinputs_size(tx_noinputs_size)
639 bool Unlock(
const CKeyingMaterial& vMasterKeyIn,
bool accept_no_keys =
false);
641 std::atomic<bool> fAbortRescan{
false};
642 std::atomic<bool> fScanningWallet{
false};
643 std::atomic<int64_t> m_scanning_start{0};
644 std::atomic<double> m_scanning_progress{0};
650 int64_t nNextResend = 0;
651 bool fBroadcastTransactions =
false;
653 std::atomic<int64_t> m_best_block_time {0};
660 typedef std::multimap<COutPoint, uint256>
TxSpends;
681 void MarkConflicted(
const uint256& hashBlock,
int conflicting_height,
const uint256& hashTx);
692 std::atomic<uint64_t> m_wallet_flags{0};
697 void UnsetWalletFlagWithDB(
WalletBatch& batch, uint64_t flag);
700 void UnsetBlankWalletFlag(
WalletBatch& batch)
override;
725 int m_last_block_processed_height
GUARDED_BY(cs_wallet) = -1;
757 bool SelectCoins(
const std::vector<COutput>& vAvailableCoins,
const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet,
CAmount& nValueRet,
762 const std::string&
GetName()
const {
return m_name; }
766 unsigned int nMasterKeyMaxID = 0;
772 database(
std::move(database))
782 bool IsCrypted()
const;
783 bool IsLocked()
const override;
787 bool HaveChain()
const {
return m_chain ?
true :
false; }
789 std::map<uint256, CWalletTx> mapWallet
GUARDED_BY(cs_wallet);
791 typedef std::multimap<int64_t, CWalletTx*>
TxItems;
794 int64_t nOrderPosNext
GUARDED_BY(cs_wallet) = 0;
795 uint64_t nAccountingEntryNumber = 0;
797 std::map<CTxDestination, CAddressBookData> m_address_book
GUARDED_BY(cs_wallet);
800 std::set<
COutPoint> setLockedCoins GUARDED_BY(cs_wallet);
806 interfaces::Chain& chain()
const { assert(m_chain);
return *m_chain; }
836 std::set<CInputCoin>& setCoinsRet,
CAmount& nValueRet,
const CoinSelectionParams& coin_selection_params,
bool& bnb_used)
const;
844 std::vector<OutputGroup> GroupOutputs(
const std::vector<COutput>& outputs,
bool single_coin,
const size_t max_ancestors)
const;
859 double ScanningProgress()
const {
return fScanningWallet ? (double) m_scanning_progress : 0; }
885 bool Unlock(
const SecureString& strWalletPassphrase,
bool accept_no_keys =
false);
886 bool ChangeWalletPassphrase(
const SecureString& strOldWalletPassphrase,
const SecureString& strNewWalletPassphrase);
887 bool EncryptWallet(
const SecureString& strWalletPassphrase);
890 unsigned int ComputeTimeSmart(
const CWalletTx& wtx)
const;
911 void transactionAddedToMempool(
const CTransactionRef& tx, uint64_t mempool_sequence)
override;
912 void blockConnected(
const CBlock& block,
int height)
override;
913 void blockDisconnected(
const CBlock& block,
int height)
override;
914 void updatedBlockTip()
override;
934 void ReacceptWalletTransactions() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
935 void ResendWalletTransactions();
944 Balance GetBalance(
int min_depth = 0,
bool avoid_reuse =
true)
const;
958 SigningResult SignMessage(
const std::string& message,
const PKHash& pkhash, std::string& str_sig)
const;
975 int sighash_type = 1 ,
977 bool bip32derivs =
true,
978 size_t* n_signed =
nullptr)
const;
999 std::vector<CTxOut> v_txouts(txouts.size());
1000 std::copy(txouts.begin(), txouts.end(), v_txouts.begin());
1001 return DummySignTx(txNew, v_txouts, use_max_sig);
1003 bool DummySignTx(
CMutableTransaction &txNew,
const std::vector<CTxOut> &txouts,
bool use_max_sig =
false)
const;
1004 bool DummySignInput(
CTxIn &tx_in,
const CTxOut &txout,
bool use_max_sig =
false)
const;
1007 bool ImportPrivKeys(
const std::map<CKeyID, CKey>& privkey_map,
const int64_t timestamp)
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
1008 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);
1009 bool ImportScriptPubKeys(
const std::string& label,
const std::set<CScript>& script_pub_keys,
const bool have_solving_data,
const bool apply_label,
const int64_t timestamp)
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
1015 bool m_allow_fallback_fee{
true};
1037 bool TopUpKeyPool(
unsigned int kpSize = 0);
1039 int64_t GetOldestKeyPoolTime()
const;
1042 std::map<CTxDestination, CAmount> GetAddressBalances()
const;
1044 std::set<CTxDestination> GetLabelAddresses(
const std::string& label)
const;
1081 bool SetAddressBook(
const CTxDestination& address,
const std::string& strName,
const std::string& purpose);
1113 &address,
const std::string &label,
bool isMine,
1114 const std::string &purpose,
1121 boost::signals2::signal<void (
CWallet *wallet,
const uint256 &hashTx,
1125 boost::signals2::signal<void (const std::string &title, int nProgress)>
ShowProgress;
1145 bool TransactionCanBeAbandoned(
const uint256& hashTx)
const;
1148 bool AbandonTransaction(
const uint256& hashTx);
1151 bool MarkReplaced(
const uint256& originalHash,
const uint256& newHash);
1154 static std::shared_ptr<CWallet> Create(
interfaces::Chain& chain,
const std::string&
name, std::unique_ptr<WalletDatabase> database, uint64_t wallet_creation_flags,
bilingual_str& error, std::vector<bilingual_str>& warnings);
1160 void postInitProcess();
1162 bool BackupWallet(
const std::string& strDest)
const;
1165 bool IsHDEnabled()
const;
1168 bool CanGetAddresses(
bool internal =
false)
const;
1179 void SetWalletFlag(uint64_t
flags);
1182 void UnsetWalletFlag(uint64_t flag);
1185 bool IsWalletFlagSet(uint64_t flag)
const override;
1189 bool AddWalletFlags(uint64_t flags);
1191 bool LoadWalletFlags(uint64_t flags);
1194 bool IsLegacy()
const;
1198 std::string wallet_name = GetName().length() == 0 ?
"default wallet" : GetName();
1203 template<
typename...
Params>
1205 LogPrintf((
"%s " + fmt).c_str(), GetDisplayName(), parameters...);
1212 std::set<ScriptPubKeyMan*> GetActiveScriptPubKeyMans()
const;
1215 std::set<ScriptPubKeyMan*> GetAllScriptPubKeyMans()
const;
1226 std::set<ScriptPubKeyMan*> GetScriptPubKeyMans(
const CScript& script,
SignatureData& sigdata)
const;
1229 std::unique_ptr<SigningProvider> GetSolvingProvider(
const CScript& script)
const;
1230 std::unique_ptr<SigningProvider> GetSolvingProvider(
const CScript& script,
SignatureData& sigdata)
const;
1237 void SetupLegacyScriptPubKeyMan();
1240 bool HasEncryptionKeys()
const override;
1246 assert(m_last_block_processed_height >= 0);
1247 return m_last_block_processed_height;
1252 assert(m_last_block_processed_height >= 0);
1253 return m_last_block_processed;
1259 m_last_block_processed_height = block_height;
1260 m_last_block_processed = block_hash;
1264 void ConnectScriptPubKeyManNotifiers();
1308 assert(!m_could_reserve);
1314 m_could_reserve =
true;
1325 if (m_could_reserve) {
1344 #endif // BITCOIN_WALLET_WALLET_H std::shared_ptr< const CTransaction > CTransactionRef
constexpr CAmount HIGH_APS_FEE
discourage APS fee higher than this amount
std::function< bool(CWalletTx &wtx, bool new_tx)> UpdateWalletTxFn
Callback for updating transaction metadata in mapWallet.
const std::string & GetName() const
Get a name for this wallet for logging/debugging purposes.
std::atomic< bool > fScanningWallet
#define NO_THREAD_SAFETY_ANALYSIS
const uint256 & GetHash() const
std::shared_ptr< CWallet > CreateWallet(interfaces::Chain &chain, const std::string &name, Optional< bool > load_on_start, DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings)
std::unique_ptr< WalletDatabase > database
Internal database handle.
bool AddWalletSetting(interfaces::Chain &chain, const std::string &wallet_name)
Add wallet name to persistent configuration so it will be loaded on startup.
void SignTransaction(CMutableTransaction &mtx, const SigningProvider *keystore, const std::map< COutPoint, Coin > &coins, const UniValue &hashType, UniValue &result)
Sign a transaction with the given keystore and previous transactions.
bool CanSupportFeature(enum WalletFeature wf) const override EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
check whether we support the named feature
bool IsFeatureSupported(int wallet_version, int feature_version)
static const CAmount DEFAULT_MAX_AVOIDPARTIALSPEND_FEE
maximum fee increase allowed to do partial spend avoidance, even for nodes with this feature disabled...
void WalletLogPrintf(std::string fmt, Params...parameters) const
Prepends the wallet name in logging output to ease debugging in multi-wallet use cases.
std::unique_ptr< WalletDatabase > MakeWalletDatabase(const std::string &name, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error)
WalletDatabase & GetDatabase() const override
bool DummySignTx(CMutableTransaction &txNew, const std::set< CTxOut > &txouts, bool use_max_sig=false) const
std::map< std::string, std::string > mapValue_t
bool fSolvable
Whether we know how to spend this output, ignoring the lack of keys.
CFeeRate m_effective_feerate
constexpr CAmount DEFAULT_TRANSACTION_MAXFEE
-maxtxfee default
std::function< void(std::unique_ptr< interfaces::Wallet > wallet)> LoadWalletFn
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
boost::signals2::signal< void()> NotifyCanGetAddressesChanged
Keypool has new keys.
constexpr CAmount HIGH_MAX_TX_FEE
-maxtxfee will warn if called with a higher fee than this amount (in satoshis)
CTxDestination address
The destination.
std::map< OutputType, ScriptPubKeyMan * > m_internal_spk_managers
constexpr CAmount DEFAULT_PAY_TX_FEE
-paytxfee default
int64_t GetTimeMillis()
Returns the system time (not mockable)
static const CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
static void LogPrintf(const char *fmt, const Args &...args)
uint256 last_scanned_block
Hash and height of most recent block that was successfully scanned.
bool use_max_sig
Whether to use the maximum sized, 72 byte signature when calculating the size of the input spend...
static const CAmount COIN
bool AddWallet(const std::shared_ptr< CWallet > &wallet)
std::multimap< COutPoint, uint256 > TxSpends
Used to keep track of spent outpoints, and detect and report conflicts (double-spends or mutated tran...
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
int64_t nOrderPos
position in ordered transaction list
bool RemoveWalletSetting(interfaces::Chain &chain, const std::string &wallet_name)
Remove wallet name from persistent configuration so it will not be loaded on startup.
std::multimap< int64_t, CWalletTx * >::const_iterator m_it_wtxOrdered
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
static void ReadOrderPos(int64_t &nOrderPos, mapValue_t &mapValue)
const std::map< uint64_t, std::string > WALLET_FLAG_CAVEATS
double ScanningProgress() const
int nWalletVersion GUARDED_BY(cs_wallet)
the current wallet version: clients below this version are not able to load the wallet ...
static const bool DEFAULT_DISABLE_WALLET
void MarkDirty()
make sure balances are recalculated
MemPoolRemovalReason
Reason why a transaction was removed from the mempool, this is passed to the notification signal...
bool fSubtractFeeFromAmount
A version of CTransaction with the PSBT format.
std::map< unsigned int, CMasterKey > MasterKeyMap
int nInputBytes
Pre-computed estimated size of this output as a fully-signed input in a transaction.
void UnloadWallet(std::shared_ptr< CWallet > &&wallet)
Explicitly unload and delete the wallet.
boost::signals2::signal< void(CWallet *wallet)> NotifyStatusChanged
Wallet status (encrypted, locked) changed.
DBErrors
Error statuses for the wallet database.
CoinSelectionParams coin_selection_params(false, 0, 0, CFeeRate(0), CFeeRate(0), CFeeRate(0), 0)
std::map< OutputType, ScriptPubKeyMan * > m_external_spk_managers
bool fSpendable
Whether we have the private keys to spend this output.
int GetLastBlockHeight() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
Get last block processed height.
int GetSpendSize(unsigned int out, bool use_max_sig=false) const
bool fFromMe
From me flag is set to 1 for transactions that were created by the wallet on this bitcoin node...
static const bool DEFAULT_WALLET_RBF
-walletrbf default
WalletFeature
(client) version numbers for particular wallet features
const std::string & GetLabel() const
bool GetBroadcastTransactions() const
Inquire whether this wallet broadcasts transactions.
CWalletTx(const CWallet *wallet, CTransactionRef arg)
Access to the wallet database.
mapValue_t mapValue
Key/value map with information about the transaction.
std::unique_ptr< interfaces::Handler > HandleLoadWallet(LoadWalletFn load_wallet)
bool RemoveWallet(const std::shared_ptr< CWallet > &wallet, Optional< bool > load_on_start, std::vector< bilingual_str > &warnings)
int64_t CAmount
Amount in satoshis (Can be negative)
boost::signals2::signal< void()> NotifyUnload
Wallet is about to be unloaded.
static const CAmount DEFAULT_FALLBACK_FEE
-fallbackfee default
boost::signals2::signal< void(CWallet *wallet, const uint256 &hashTx, ChangeType status)> NotifyTransactionChanged
Wallet transaction added, removed or updated.
void SetBroadcastTransactions(bool broadcast)
Set whether this wallet broadcasts transactions.
std::string ToString(const T &t)
Locale-independent version of std::to_string.
int64_t ScanningDuration() const
COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn, bool fSolvableIn, bool fSafeIn, bool use_max_sig_in=false)
CInputCoin GetInputCoin() const
bool error(const char *fmt, const Args &...args)
static const std::map< std::string, WalletFlags > WALLET_FLAG_MAP
std::shared_ptr< CWallet > LoadWallet(interfaces::Chain &chain, const std::string &name, Optional< bool > load_on_start, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings)
void Unserialize(Stream &s)
int GetVersion() const
get the current wallet format (the oldest client version guaranteed to understand this wallet) ...
void Serialize(Stream &s) const
CWallet(interfaces::Chain *chain, const std::string &name, std::unique_ptr< WalletDatabase > database)
Construct wallet with specified name and database implementation.
An input of a transaction.
int CalculateMaximumSignedInputSize(const CTxOut &txout, const CWallet *pwallet, bool use_max_sig=false)
void SetTx(CTransactionRef arg)
AssertLockHeld(mempool.cs)
bool fSafe
Whether this output is considered safe to spend.
bool HaveChain() const
Interface to assert chain access.
int64_t nIndex
The index of the address's key in the keypool.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...
interfaces::Chain * m_chain
Interface for accessing chain state.
static const bool DEFAULT_WALLETBROADCAST
std::map< std::string, std::string > StringMap
Flag set when a wallet contains no HD seed and no private keys, scripts, addresses, and other watch only things, and is therefore "blank.".
WalletDatabase & GetDBHandle()
Get database handle used by this wallet.
ReserveDestination(CWallet *pwallet, OutputType type)
Construct a ReserveDestination object. This does NOT reserve an address yet.
uint256 GetLastBlockHash() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
ReserveDestination & operator=(const ReserveDestination &)=delete
static const bool DEFAULT_SPEND_ZEROCONF_CHANGE
Default for -spendzeroconfchange.
constexpr OutputType DEFAULT_ADDRESS_TYPE
Default for -addresstype.
isminetype
IsMine() return codes.
void SetLastBlockProcessed(int block_height, uint256 block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
Set last block processed height, currently only use in unit test.
An output of a transaction.
std::shared_ptr< CWallet > GetWallet(const std::string &name)
Descriptor with some wallet metadata.
static const unsigned int DEFAULT_TX_CONFIRM_TARGET
-txconfirmtarget default
bool IsFromMe(const isminefilter &filter) const
An outpoint - a combination of a transaction hash and an index n into its vout.
unsigned int fTimeReceivedIsTxTime
~ReserveDestination()
Destructor. If a key has been reserved and not KeepKey'ed, it will be returned to the keypool...
RAII object to check and reserve a wallet rescan.
A transaction with a bunch of additional info that only the owner cares about.
int64_t atoi64(const std::string &str)
std::map< uint256, std::unique_ptr< ScriptPubKeyMan > > m_spk_managers
bool isConflicted() const
bool IsAbortingRescan() const
static constexpr uint64_t MUTABLE_WALLET_FLAGS
static const bool DEFAULT_WALLET_REJECT_LONG_CHAINS
Default for -walletrejectlongchains.
static void NotifyUnload(WalletModel *walletModel)
Cachable amount subdivided into watchonly and spendable parts.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
static const CAmount DEFAULT_TRANSACTION_MINFEE
-mintxfee default
static void WriteOrderPos(const int64_t &nOrderPos, mapValue_t &mapValue)
Result CommitTransaction(CWallet &wallet, const uint256 &txid, CMutableTransaction &&mtx, std::vector< bilingual_str > &errors, uint256 &bumped_txid)
Commit the bumpfee transaction.
CoinSelectionParams(bool use_bnb, size_t change_output_size, size_t change_spend_size, CFeeRate effective_feerate, CFeeRate long_term_feerate, CFeeRate discard_feerate, size_t tx_noinputs_size)
boost::signals2::signal< void(CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, const std::string &purpose, ChangeType status)> NotifyAddressBookChanged
Address book entry changed.
MasterKeyMap mapMasterKeys
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
CFeeRate m_discard_feerate
const CChainParams & Params()
Return the currently selected parameters.
Serialized script, used inside transaction inputs and outputs.
CTxDestination destination
unsigned int nTimeSmart
Stable timestamp that never changes, and reflects the order a transaction was added to the wallet...
bool IsInMainChain() const
A reference to a CKey: the Hash160 of its serialized public key.
void Unserialize(Stream &s)
void SetLabel(const std::string &label)
bool GetReservedDestination(CTxDestination &pubkey, bool internal)
Reserve an address.
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Fee rate in satoshis per kilobyte: CAmount / kB.
void MaybeResendWalletTxs()
Called periodically by the schedule thread.
A wrapper to reserve an address from a wallet.
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
Show progress e.g.
bool fInternal
Whether this is from the internal (change output) keypool.
Optional< int > last_scanned_height
A mutable version of CTransaction.
uint256 last_failed_block
Height of the most recent block that could not be scanned due to read errors or pruning.
void FundTransaction(CWallet *const pwallet, CMutableTransaction &tx, CAmount &fee_out, int &change_position, const UniValue &options, CCoinControl &coinControl, bool override_min_fee)
static const CAmount WALLET_INCREMENTAL_RELAY_FEE
minimum recommended increment for BIP 125 replacement txs
bool LoadMinVersion(int nVersion) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
static std::vector< COutput > vCoins
std::atomic< int64_t > m_scanning_start
unsigned int nTimeReceived
time received by this node
std::string m_name
Wallet name: relative directory name or "" for default wallet.
The basic transaction that is broadcasted on the network and contained in blocks. ...
boost::optional< T > Optional
Substitute for C++17 std::optional.
Confirmation(Status s=UNCONFIRMED, int b=0, uint256 h=uint256(), int i=0)
boost::variant< CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
std::atomic< double > m_scanning_progress
ChangeType
General change type (added, updated, removed).
Indicate that this wallet supports DescriptorScriptPubKeyMan.
const std::string GetDisplayName() const override
Returns a bracketed wallet name for displaying in logs, will return [default wallet] if the wallet ha...
boost::signals2::signal< void(bool fHaveWatchOnly)> NotifyWatchonlyChanged
Watch-only address added.
CFeeRate m_long_term_feerate
std::multimap< int64_t, CWalletTx * > TxItems
const CWallet *const pwallet
The wallet to reserve from.
WalletRescanReserver(CWallet &w)
static const CAmount DEFAULT_DISCARD_FEE
-discardfee default
int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *wallet, bool use_max_sig=false) EXCLUSIVE_LOCKS_REQUIRED(wallet-> cs_wallet)
std::vector< std::shared_ptr< CWallet > > GetWallets()
Legacy class used for deserializing vtxPrev for backwards compatibility.
const CWallet *const pwallet
static constexpr uint64_t KNOWN_WALLET_FLAGS
void KeepDestination()
Keep the address. Do not return it's key to the keypool when this object goes out of scope...
constexpr CAmount HIGH_TX_FEE_PER_KB
Discourage users to set fees higher than this amount (in satoshis) per kB.
std::vector< std::pair< std::string, std::string > > vOrderForm
void ReturnDestination()
Return reserved address.
ScriptPubKeyMan * m_spk_man
The ScriptPubKeyMan to reserve from. Based on type when GetReservedDestination is called...
An instance of this class represents one database.
bool isUnconfirmed() const
static constexpr size_t DUMMY_NESTED_P2WPKH_INPUT_SIZE
Pre-calculated constants for input size estimation in virtual size