Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 994 Lines • ▼ Show 20 Lines | public: | ||||
bool FundTransaction(CMutableTransaction &tx, Amount &nFeeRet, | bool FundTransaction(CMutableTransaction &tx, Amount &nFeeRet, | ||||
bool overrideEstimatedFeeRate, | bool overrideEstimatedFeeRate, | ||||
const CFeeRate &specificFeeRate, int &nChangePosInOut, | const CFeeRate &specificFeeRate, int &nChangePosInOut, | ||||
std::string &strFailReason, bool includeWatching, | std::string &strFailReason, bool includeWatching, | ||||
bool lockUnspents, | bool lockUnspents, | ||||
const std::set<int> &setSubtractFeeFromOutputs, | const std::set<int> &setSubtractFeeFromOutputs, | ||||
bool keepReserveKey = true, | bool keepReserveKey = true, | ||||
const CTxDestination &destChange = CNoDestination()); | const CTxDestination &destChange = CNoDestination()); | ||||
bool SignTransaction(CMutableTransaction &tx); | |||||
/** | /** | ||||
* Create a new transaction paying the recipients with a set of coins | * Create a new transaction paying the recipients with a set of coins | ||||
* selected by SelectCoins(); Also create the change output, when needed | * selected by SelectCoins(); Also create the change output, when needed | ||||
* @note passing nChangePosInOut as -1 will result in setting a random | * @note passing nChangePosInOut as -1 will result in setting a random | ||||
* position | * position | ||||
*/ | */ | ||||
bool CreateTransaction(const std::vector<CRecipient> &vecSend, | bool CreateTransaction(const std::vector<CRecipient> &vecSend, | ||||
CWalletTx &wtxNew, CReserveKey &reservekey, | CWalletTx &wtxNew, CReserveKey &reservekey, | ||||
Amount &nFeeRet, int &nChangePosInOut, | Amount &nFeeRet, int &nChangePosInOut, | ||||
std::string &strFailReason, | std::string &strFailReason, | ||||
const CCoinControl *coinControl = nullptr, | const CCoinControl *coinControl = nullptr, | ||||
bool sign = true); | bool sign = true); | ||||
bool CommitTransaction(CWalletTx &wtxNew, CReserveKey &reservekey, | bool CommitTransaction(CWalletTx &wtxNew, CReserveKey &reservekey, | ||||
CConnman *connman, CValidationState &state); | CConnman *connman, CValidationState &state); | ||||
void ListAccountCreditDebit(const std::string &strAccount, | void ListAccountCreditDebit(const std::string &strAccount, | ||||
std::list<CAccountingEntry> &entries); | std::list<CAccountingEntry> &entries); | ||||
bool AddAccountingEntry(const CAccountingEntry &); | bool AddAccountingEntry(const CAccountingEntry &); | ||||
bool AddAccountingEntry(const CAccountingEntry &, CWalletDB *pwalletdb); | bool AddAccountingEntry(const CAccountingEntry &, CWalletDB *pwalletdb); | ||||
template <typename ContainerType> | template <typename ContainerType> | ||||
bool DummySignTx(CMutableTransaction &txNew, const ContainerType &coins); | bool DummySignTx(CMutableTransaction &txNew, | ||||
const ContainerType &coins) const; | |||||
static CFeeRate fallbackFee; | static CFeeRate fallbackFee; | ||||
bool NewKeyPool(); | bool NewKeyPool(); | ||||
size_t KeypoolCountExternalKeys(); | size_t KeypoolCountExternalKeys(); | ||||
bool TopUpKeyPool(unsigned int kpSize = 0); | bool TopUpKeyPool(unsigned int kpSize = 0); | ||||
void ReserveKeyFromKeyPool(int64_t &nIndex, CKeyPool &keypool, | void ReserveKeyFromKeyPool(int64_t &nIndex, CKeyPool &keypool, | ||||
bool fRequestedInternal); | bool fRequestedInternal); | ||||
▲ Show 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
}; | }; | ||||
// Helper for producing a bunch of max-sized low-S signatures (eg 72 bytes) | // Helper for producing a bunch of max-sized low-S signatures (eg 72 bytes) | ||||
// ContainerType is meant to hold pair<CWalletTx *, int>, and be iterable so | // ContainerType is meant to hold pair<CWalletTx *, int>, and be iterable so | ||||
// that each entry corresponds to each vIn, in order. | // that each entry corresponds to each vIn, in order. | ||||
template <typename ContainerType> | template <typename ContainerType> | ||||
bool CWallet::DummySignTx(CMutableTransaction &txNew, | bool CWallet::DummySignTx(CMutableTransaction &txNew, | ||||
const ContainerType &coins) { | const ContainerType &coins) const { | ||||
// Fill in dummy signatures for fee calculation. | // Fill in dummy signatures for fee calculation. | ||||
int nIn = 0; | int nIn = 0; | ||||
for (const auto &coin : coins) { | for (const auto &coin : coins) { | ||||
const CScript &scriptPubKey = coin.txout.scriptPubKey; | const CScript &scriptPubKey = coin.txout.scriptPubKey; | ||||
SignatureData sigdata; | SignatureData sigdata; | ||||
if (!ProduceSignature(DummySignatureCreator(this), scriptPubKey, | if (!ProduceSignature(DummySignatureCreator(this), scriptPubKey, | ||||
sigdata)) { | sigdata)) { | ||||
Show All 12 Lines |