Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/spend.cpp
Show First 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | std::vector<OutputGroup> GroupOutputs(const CWallet &wallet, | ||||
for (const auto &output : outputs) { | for (const auto &output : outputs) { | ||||
if (output.fSpendable) { | if (output.fSpendable) { | ||||
CTxDestination dst; | CTxDestination dst; | ||||
CInputCoin input_coin = output.GetInputCoin(); | CInputCoin input_coin = output.GetInputCoin(); | ||||
// deprecated -- after wellington activation these 2 stats should | // deprecated -- after wellington activation these 2 stats should | ||||
// always just be 0 since these stat becomes irrelevant at that | // always just be 0 since these stat becomes irrelevant at that | ||||
// point | // point | ||||
size_t ancestors, descendants; | size_t ancestors = 0, descendants = 0; | ||||
wallet.chain().getTransactionAncestry(output.tx->GetId(), ancestors, | |||||
descendants); | |||||
if (!single_coin && | if (!single_coin && | ||||
ExtractDestination(output.tx->tx->vout[output.i].scriptPubKey, | ExtractDestination(output.tx->tx->vout[output.i].scriptPubKey, | ||||
dst)) { | dst)) { | ||||
auto it = gmap.find(dst); | auto it = gmap.find(dst); | ||||
if (it != gmap.end()) { | if (it != gmap.end()) { | ||||
// Limit output groups to no more than | // Limit output groups to no more than | ||||
// OUTPUT_GROUP_MAX_ENTRIES number of entries, to protect | // OUTPUT_GROUP_MAX_ENTRIES number of entries, to protect | ||||
▲ Show 20 Lines • Show All 615 Lines • ▼ Show 20 Lines | CMutableTransaction txNew; | ||||
} | } | ||||
} | } | ||||
if (nFeeRet > wallet.m_default_max_tx_fee) { | if (nFeeRet > wallet.m_default_max_tx_fee) { | ||||
error = TransactionErrorString(TransactionError::MAX_FEE_EXCEEDED); | error = TransactionErrorString(TransactionError::MAX_FEE_EXCEEDED); | ||||
return false; | return false; | ||||
} | } | ||||
// After wellington this option will no longer exist | |||||
if (gArgs.GetBoolArg("-walletrejectlongchains", | |||||
DEFAULT_WALLET_REJECT_LONG_CHAINS)) { | |||||
// Lastly, ensure this tx will pass the mempool's chain limits | |||||
if (!wallet.chain().checkChainLimits(tx)) { | |||||
error = _("Transaction has too long of a mempool chain"); | |||||
return false; | |||||
} | |||||
} | |||||
// Before we return success, we assume any change key will be used to | // Before we return success, we assume any change key will be used to | ||||
// prevent accidental re-use. | // prevent accidental re-use. | ||||
reservedest.KeepDestination(); | reservedest.KeepDestination(); | ||||
return true; | return true; | ||||
} | } | ||||
bool CreateTransaction(CWallet &wallet, const std::vector<CRecipient> &vecSend, | bool CreateTransaction(CWallet &wallet, const std::vector<CRecipient> &vecSend, | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |