Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 481 Lines • ▼ Show 20 Lines | public: | ||||
//! filter decides which addresses will count towards the debit | //! filter decides which addresses will count towards the debit | ||||
Amount GetDebit(const isminefilter &filter) const; | Amount GetDebit(const isminefilter &filter) const; | ||||
Amount GetCredit(const isminefilter &filter) const | Amount GetCredit(const isminefilter &filter) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
Amount GetImmatureCredit(bool fUseCache = true) const | Amount GetImmatureCredit(bool fUseCache = true) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
Amount | Amount | ||||
// TODO: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct | |||||
// annotation "EXCLUSIVE_LOCKS_REQUIRED(cs_main, pwallet->cs_wallet)". The | |||||
// annotation "NO_THREAD_SAFETY_ANALYSIS" was temporarily added to avoid | |||||
// having to resolve the issue of member access into incomplete type | |||||
// CWallet. | |||||
GetAvailableCredit(bool fUseCache = true, | GetAvailableCredit(bool fUseCache = true, | ||||
const isminefilter &filter = ISMINE_SPENDABLE) const | const isminefilter &filter = ISMINE_SPENDABLE) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | NO_THREAD_SAFETY_ANALYSIS; | ||||
Amount GetImmatureWatchOnlyCredit(const bool fUseCache = true) const | Amount GetImmatureWatchOnlyCredit(const bool fUseCache = true) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
Amount GetChange() const; | Amount GetChange() const; | ||||
// Get the marginal bytes if spending the specified output from this | // Get the marginal bytes if spending the specified output from this | ||||
// transaction | // transaction | ||||
int GetSpendSize(unsigned int out, bool use_max_sig = false) const { | int GetSpendSize(unsigned int out, bool use_max_sig = false) const { | ||||
return CalculateMaximumSignedInputSize(tx->vout[out], pwallet, | return CalculateMaximumSignedInputSize(tx->vout[out], pwallet, | ||||
Show All 23 Lines | public: | ||||
/** | /** | ||||
* Pass this transaction to the mempool. Fails if absolute fee exceeds | * Pass this transaction to the mempool. Fails if absolute fee exceeds | ||||
* absurd fee. | * absurd fee. | ||||
*/ | */ | ||||
bool AcceptToMemoryPool(const Amount nAbsurdFee, CValidationState &state) | bool AcceptToMemoryPool(const Amount nAbsurdFee, CValidationState &state) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
std::set<TxId> GetConflicts() const; | // TODO: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct | ||||
// annotation "EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)". The annotation | |||||
// "NO_THREAD_SAFETY_ANALYSIS" was temporarily added to avoid having to | |||||
// resolve the issue of member access into incomplete type CWallet. Note | |||||
// that we still have the runtime check "AssertLockHeld(pwallet->cs_wallet)" | |||||
// in place. | |||||
std::set<TxId> GetConflicts() const NO_THREAD_SAFETY_ANALYSIS; | |||||
}; | }; | ||||
class COutput { | class COutput { | ||||
public: | public: | ||||
const CWalletTx *tx; | const CWalletTx *tx; | ||||
int i; | int i; | ||||
int nDepth; | int nDepth; | ||||
▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | |||||
private: | private: | ||||
static std::atomic<bool> fFlushScheduled; | static std::atomic<bool> fFlushScheduled; | ||||
std::atomic<bool> fAbortRescan{false}; | std::atomic<bool> fAbortRescan{false}; | ||||
// controlled by WalletRescanReserver | // controlled by WalletRescanReserver | ||||
std::atomic<bool> fScanningWallet{false}; | std::atomic<bool> fScanningWallet{false}; | ||||
std::mutex mutexScanning; | std::mutex mutexScanning; | ||||
friend class WalletRescanReserver; | friend class WalletRescanReserver; | ||||
WalletBatch *encrypted_batch = nullptr; | WalletBatch *encrypted_batch GUARDED_BY(cs_wallet) = nullptr; | ||||
//! the current wallet version: clients below this version are not able to | //! the current wallet version: clients below this version are not able to | ||||
//! load the wallet | //! load the wallet | ||||
int nWalletVersion = FEATURE_BASE; | int nWalletVersion = FEATURE_BASE; | ||||
//! the maximum wallet format version: memory-only variable that specifies | //! the maximum wallet format version: memory-only variable that specifies | ||||
//! to what version this wallet may be upgraded | //! to what version this wallet may be upgraded | ||||
int nWalletMaxVersion = FEATURE_BASE; | int nWalletMaxVersion GUARDED_BY(cs_wallet) = FEATURE_BASE; | ||||
int64_t nNextResend = 0; | int64_t nNextResend = 0; | ||||
int64_t nLastResend = 0; | int64_t nLastResend = 0; | ||||
bool fBroadcastTransactions = false; | bool fBroadcastTransactions = false; | ||||
/** | /** | ||||
* Used to keep track of spent outpoints, and detect and report conflicts | * Used to keep track of spent outpoints, and detect and report conflicts | ||||
* (double-spends or mutated transactions where the mutant gets mined). | * (double-spends or mutated transactions where the mutant gets mined). | ||||
*/ | */ | ||||
typedef std::multimap<COutPoint, TxId> TxSpends; | typedef std::multimap<COutPoint, TxId> TxSpends; | ||||
TxSpends mapTxSpends; | TxSpends mapTxSpends GUARDED_BY(cs_wallet); | ||||
void AddToSpends(const COutPoint &outpoint, const TxId &wtxid); | void AddToSpends(const COutPoint &outpoint, const TxId &wtxid) | ||||
void AddToSpends(const TxId &wtxid); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
void AddToSpends(const TxId &wtxid) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
/** | /** | ||||
* Add a transaction to the wallet, or update it. pIndex and posInBlock | * Add a transaction to the wallet, or update it. pIndex and posInBlock | ||||
* should be set when the transaction was known to be included in a | * should be set when the transaction was known to be included in a | ||||
* block. When *pIndex == nullptr, then wallet state is not updated in | * block. When *pIndex == nullptr, then wallet state is not updated in | ||||
* AddToWallet, but notifications happen and cached balances are marked | * AddToWallet, but notifications happen and cached balances are marked | ||||
* dirty. | * dirty. | ||||
* | * | ||||
Show All 15 Lines | private: | ||||
* particular block. | * particular block. | ||||
*/ | */ | ||||
void MarkConflicted(const BlockHash &hashBlock, const TxId &txid); | void MarkConflicted(const BlockHash &hashBlock, const TxId &txid); | ||||
/** | /** | ||||
* Mark a transaction's inputs dirty, thus forcing the outputs to be | * Mark a transaction's inputs dirty, thus forcing the outputs to be | ||||
* recomputed | * recomputed | ||||
*/ | */ | ||||
void MarkInputsDirty(const CTransactionRef &tx); | void MarkInputsDirty(const CTransactionRef &tx) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>); | void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
/** | /** | ||||
* Used by | * Used by | ||||
* TransactionAddedToMemorypool/BlockConnected/Disconnected/ScanForWalletTransactions. | * TransactionAddedToMemorypool/BlockConnected/Disconnected/ScanForWalletTransactions. | ||||
* Should be called with pindexBlock and posInBlock if this is for a | * Should be called with pindexBlock and posInBlock if this is for a | ||||
* transaction that is included in a block. | * transaction that is included in a block. | ||||
*/ | */ | ||||
void SyncTransaction(const CTransactionRef &tx, | void SyncTransaction(const CTransactionRef &tx, | ||||
const CBlockIndex *pindex = nullptr, | const CBlockIndex *pindex = nullptr, | ||||
int posInBlock = 0, bool update_tx = true) | int posInBlock = 0, bool update_tx = true) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
/* the HD chain data model (external chain counters) */ | /* the HD chain data model (external chain counters) */ | ||||
CHDChain hdChain; | CHDChain hdChain; | ||||
/* HD derive new child key (on internal or external chain) */ | /* HD derive new child key (on internal or external chain) */ | ||||
void DeriveNewChildKey(WalletBatch &batch, CKeyMetadata &metadata, | void DeriveNewChildKey(WalletBatch &batch, CKeyMetadata &metadata, | ||||
CKey &secret, bool internal = false) | CKey &secret, bool internal = false) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
std::set<int64_t> setInternalKeyPool; | std::set<int64_t> setInternalKeyPool; | ||||
std::set<int64_t> setExternalKeyPool; | std::set<int64_t> setExternalKeyPool GUARDED_BY(cs_wallet); | ||||
std::set<int64_t> set_pre_split_keypool; | std::set<int64_t> set_pre_split_keypool; | ||||
int64_t m_max_keypool_index = 0; | int64_t m_max_keypool_index GUARDED_BY(cs_wallet) = 0; | ||||
std::map<CKeyID, int64_t> m_pool_key_to_index; | std::map<CKeyID, int64_t> m_pool_key_to_index; | ||||
std::atomic<uint64_t> m_wallet_flags{0}; | std::atomic<uint64_t> m_wallet_flags{0}; | ||||
int64_t nTimeFirstKey = 0; | int64_t nTimeFirstKey GUARDED_BY(cs_wallet) = 0; | ||||
/** | /** | ||||
* Private version of AddWatchOnly method which does not accept a timestamp, | * Private version of AddWatchOnly method which does not accept a timestamp, | ||||
* and which will reset the wallet's nTimeFirstKey value to 1 if the watch | * and which will reset the wallet's nTimeFirstKey value to 1 if the watch | ||||
* key did not previously have a timestamp associated with it. Because this | * key did not previously have a timestamp associated with it. Because this | ||||
* is an inherited virtual method, it is accessible despite being marked | * is an inherited virtual method, it is accessible despite being marked | ||||
* private, but it is marked private anyway to encourage use of the other | * private, but it is marked private anyway to encourage use of the other | ||||
* AddWatchOnly which accepts a timestamp and sets nTimeFirstKey more | * AddWatchOnly which accepts a timestamp and sets nTimeFirstKey more | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | public: | ||||
* all coins from coinControl are selected; Never select unconfirmed coins | * all coins from coinControl are selected; Never select unconfirmed coins | ||||
* if they are not ours. | * if they are not ours. | ||||
*/ | */ | ||||
bool SelectCoins(const std::vector<COutput> &vAvailableCoins, | bool SelectCoins(const std::vector<COutput> &vAvailableCoins, | ||||
const Amount nTargetValue, | const Amount nTargetValue, | ||||
std::set<CInputCoin> &setCoinsRet, Amount &nValueRet, | std::set<CInputCoin> &setCoinsRet, Amount &nValueRet, | ||||
const CCoinControl &coin_control, | const CCoinControl &coin_control, | ||||
CoinSelectionParams &coin_selection_params, | CoinSelectionParams &coin_selection_params, | ||||
bool &bnb_used) const; | bool &bnb_used) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
const WalletLocation &GetLocation() const { return m_location; } | const WalletLocation &GetLocation() const { return m_location; } | ||||
/** | /** | ||||
* Get a name for this wallet for logging/debugging purposes. | * Get a name for this wallet for logging/debugging purposes. | ||||
*/ | */ | ||||
const std::string &GetName() const { return m_location.GetName(); } | const std::string &GetName() const { return m_location.GetName(); } | ||||
void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool) | void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
void MarkPreSplitKeys(); | void MarkPreSplitKeys() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
// Map from Key ID to key metadata. | // Map from Key ID to key metadata. | ||||
std::map<CKeyID, CKeyMetadata> mapKeyMetadata; | std::map<CKeyID, CKeyMetadata> mapKeyMetadata GUARDED_BY(cs_wallet); | ||||
// Map from Script ID to key metadata (for watch-only keys). | // Map from Script ID to key metadata (for watch-only keys). | ||||
std::map<CScriptID, CKeyMetadata> m_script_metadata; | std::map<CScriptID, CKeyMetadata> m_script_metadata GUARDED_BY(cs_wallet); | ||||
typedef std::map<unsigned int, CMasterKey> MasterKeyMap; | typedef std::map<unsigned int, CMasterKey> MasterKeyMap; | ||||
MasterKeyMap mapMasterKeys; | MasterKeyMap mapMasterKeys; | ||||
unsigned int nMasterKeyMaxID = 0; | unsigned int nMasterKeyMaxID = 0; | ||||
/** Construct wallet with specified name and database implementation. */ | /** Construct wallet with specified name and database implementation. */ | ||||
CWallet(const CChainParams &chainParamsIn, const WalletLocation &location, | CWallet(const CChainParams &chainParamsIn, const WalletLocation &location, | ||||
std::unique_ptr<WalletDatabase> databaseIn) | std::unique_ptr<WalletDatabase> databaseIn) | ||||
: m_location(location), database(std::move(databaseIn)), | : m_location(location), database(std::move(databaseIn)), | ||||
chainParams(chainParamsIn) {} | chainParams(chainParamsIn) {} | ||||
~CWallet() { | ~CWallet() { | ||||
delete encrypted_batch; | delete encrypted_batch; | ||||
encrypted_batch = nullptr; | encrypted_batch = nullptr; | ||||
} | } | ||||
std::map<TxId, CWalletTx> mapWallet; | std::map<TxId, CWalletTx> mapWallet GUARDED_BY(cs_wallet); | ||||
std::list<CAccountingEntry> laccentries; | std::list<CAccountingEntry> laccentries; | ||||
typedef std::pair<CWalletTx *, CAccountingEntry *> TxPair; | typedef std::pair<CWalletTx *, CAccountingEntry *> TxPair; | ||||
typedef std::multimap<int64_t, TxPair> TxItems; | typedef std::multimap<int64_t, TxPair> TxItems; | ||||
TxItems wtxOrdered; | TxItems wtxOrdered; | ||||
int64_t nOrderPosNext = 0; | int64_t nOrderPosNext GUARDED_BY(cs_wallet) = 0; | ||||
uint64_t nAccountingEntryNumber = 0; | uint64_t nAccountingEntryNumber = 0; | ||||
std::map<CTxDestination, CAddressBookData> mapAddressBook; | std::map<CTxDestination, CAddressBookData> mapAddressBook; | ||||
std::set<COutPoint> setLockedCoins; | std::set<COutPoint> setLockedCoins GUARDED_BY(cs_wallet); | ||||
const CWalletTx *GetWalletTx(const TxId &txid) const; | const CWalletTx *GetWalletTx(const TxId &txid) const; | ||||
//! check whether we are allowed to upgrade (or already support) to the | //! check whether we are allowed to upgrade (or already support) to the | ||||
//! named feature | //! named feature | ||||
bool CanSupportFeature(enum WalletFeature wf) const | bool CanSupportFeature(enum WalletFeature wf) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | ||||
AssertLockHeld(cs_wallet); | AssertLockHeld(cs_wallet); | ||||
Show All 19 Lines | public: | ||||
*/ | */ | ||||
std::map<CTxDestination, std::vector<COutput>> ListCoins() const | std::map<CTxDestination, std::vector<COutput>> ListCoins() const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main, cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_main, cs_wallet); | ||||
/** | /** | ||||
* Find non-change parent output. | * Find non-change parent output. | ||||
*/ | */ | ||||
const CTxOut &FindNonChangeParentOutput(const CTransaction &tx, | const CTxOut &FindNonChangeParentOutput(const CTransaction &tx, | ||||
int output) const; | int output) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
/** | /** | ||||
* Shuffle and select coins until nTargetValue is reached while avoiding | * Shuffle and select coins until nTargetValue is reached while avoiding | ||||
* small change; This method is stochastic for some inputs and upon | * small change; This method is stochastic for some inputs and upon | ||||
* completion the coin set and corresponding actual target value is | * completion the coin set and corresponding actual target value is | ||||
* assembled. | * assembled. | ||||
*/ | */ | ||||
bool SelectCoinsMinConf(const Amount nTargetValue, | bool SelectCoinsMinConf(const Amount nTargetValue, | ||||
const CoinEligibilityFilter &eligibility_filter, | const CoinEligibilityFilter &eligibility_filter, | ||||
std::vector<OutputGroup> groups, | std::vector<OutputGroup> groups, | ||||
std::set<CInputCoin> &setCoinsRet, | std::set<CInputCoin> &setCoinsRet, | ||||
Amount &nValueRet, | Amount &nValueRet, | ||||
const CoinSelectionParams &coin_selection_params, | const CoinSelectionParams &coin_selection_params, | ||||
bool &bnb_used) const; | bool &bnb_used) const; | ||||
bool IsSpent(const COutPoint &outpoint) const | bool IsSpent(const COutPoint &outpoint) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main, cs_wallet); | ||||
std::vector<OutputGroup> GroupOutputs(const std::vector<COutput> &outputs, | std::vector<OutputGroup> GroupOutputs(const std::vector<COutput> &outputs, | ||||
bool single_coin) const; | bool single_coin) const; | ||||
bool IsLockedCoin(const COutPoint &outpoint) const | bool IsLockedCoin(const COutPoint &outpoint) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
void LockCoin(const COutPoint &output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | void LockCoin(const COutPoint &output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
void UnlockCoin(const COutPoint &output) | void UnlockCoin(const COutPoint &output) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | public: | ||||
*/ | */ | ||||
int64_t IncOrderPosNext(WalletBatch *batch = nullptr) | int64_t IncOrderPosNext(WalletBatch *batch = nullptr) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
DBErrors ReorderTransactions(); | DBErrors ReorderTransactions(); | ||||
bool AccountMove(std::string strFrom, std::string strTo, | bool AccountMove(std::string strFrom, std::string strTo, | ||||
const Amount nAmount, std::string strComment = "") | const Amount nAmount, std::string strComment = "") | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
bool GetLabelDestination(CTxDestination &dest, const std::string &label, | bool GetLabelDestination(CTxDestination &dest, const std::string &label, | ||||
bool bForceNew = false); | bool bForceNew = false) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
void MarkDirty(); | void MarkDirty(); | ||||
bool AddToWallet(const CWalletTx &wtxIn, bool fFlushOnClose = true); | bool AddToWallet(const CWalletTx &wtxIn, bool fFlushOnClose = true); | ||||
void LoadToWallet(const CWalletTx &wtxIn); | void LoadToWallet(const CWalletTx &wtxIn) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
void TransactionAddedToMempool(const CTransactionRef &tx) override; | void TransactionAddedToMempool(const CTransactionRef &tx) override; | ||||
void | void | ||||
BlockConnected(const std::shared_ptr<const CBlock> &pblock, | BlockConnected(const std::shared_ptr<const CBlock> &pblock, | ||||
const CBlockIndex *pindex, | const CBlockIndex *pindex, | ||||
const std::vector<CTransactionRef> &vtxConflicted) override; | const std::vector<CTransactionRef> &vtxConflicted) override; | ||||
void | void | ||||
BlockDisconnected(const std::shared_ptr<const CBlock> &pblock) override; | BlockDisconnected(const std::shared_ptr<const CBlock> &pblock) override; | ||||
int64_t RescanFromTime(int64_t startTime, | int64_t RescanFromTime(int64_t startTime, | ||||
▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | public: | ||||
//! understand this wallet) | //! understand this wallet) | ||||
int GetVersion() { | int GetVersion() { | ||||
LOCK(cs_wallet); | LOCK(cs_wallet); | ||||
return nWalletVersion; | return nWalletVersion; | ||||
} | } | ||||
//! Get wallet transactions that conflict with given transaction (spend same | //! Get wallet transactions that conflict with given transaction (spend same | ||||
//! outputs) | //! outputs) | ||||
std::set<TxId> GetConflicts(const TxId &txid) const; | std::set<TxId> GetConflicts(const TxId &txid) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
//! Check if a given transaction has any of its outputs spent by another | //! Check if a given transaction has any of its outputs spent by another | ||||
//! transaction in the wallet | //! transaction in the wallet | ||||
bool HasWalletSpend(const TxId &txid) const | bool HasWalletSpend(const TxId &txid) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
//! Flush wallet (bitdb flush) | //! Flush wallet (bitdb flush) | ||||
void Flush(bool shutdown = false); | void Flush(bool shutdown = false); | ||||
▲ Show 20 Lines • Show All 255 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
// Calculate the size of the transaction assuming all signatures are max size | // Calculate the size of the transaction assuming all signatures are max size | ||||
// Use DummySignatureCreator, which inserts 71 byte signatures everywhere. | // Use DummySignatureCreator, which inserts 71 byte signatures everywhere. | ||||
// NOTE: this requires that all inputs must be in mapWallet (eg the tx should | // NOTE: this requires that all inputs must be in mapWallet (eg the tx should | ||||
// be IsAllFromMe). | // be IsAllFromMe). | ||||
int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, | int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, | ||||
const CWallet *wallet, | const CWallet *wallet, | ||||
bool use_max_sig = false); | bool use_max_sig = false) | ||||
EXCLUSIVE_LOCKS_REQUIRED(wallet->cs_wallet); | |||||
int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, | int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, | ||||
const CWallet *wallet, | const CWallet *wallet, | ||||
const std::vector<CTxOut> &txouts, | const std::vector<CTxOut> &txouts, | ||||
bool use_max_sig = false); | bool use_max_sig = false); | ||||
#endif // BITCOIN_WALLET_WALLET_H | #endif // BITCOIN_WALLET_WALLET_H |