Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,907 Lines • ▼ Show 20 Lines | CWallet::GroupOutputs(const std::vector<COutput> &outputs, | ||||
std::vector<OutputGroup> groups; | std::vector<OutputGroup> groups; | ||||
std::map<CTxDestination, OutputGroup> gmap; | std::map<CTxDestination, OutputGroup> gmap; | ||||
CTxDestination dst; | CTxDestination dst; | ||||
for (const auto &output : outputs) { | for (const auto &output : outputs) { | ||||
if (output.fSpendable) { | if (output.fSpendable) { | ||||
CInputCoin input_coin = output.GetInputCoin(); | CInputCoin input_coin = output.GetInputCoin(); | ||||
size_t ancestors, descendants; | size_t ancestors, descendants; | ||||
g_mempool.GetTransactionAncestry(output.tx->GetId(), ancestors, | chain().getTransactionAncestry(output.tx->GetId(), ancestors, | ||||
descendants); | 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)) { | ||||
// Limit output groups to no more than 10 entries, to protect | // Limit output groups to no more than 10 entries, to protect | ||||
// against inadvertently creating a too-large transaction | // against inadvertently creating a too-large transaction | ||||
// when using -avoidpartialspends | // when using -avoidpartialspends | ||||
if (gmap[dst].m_outputs.size() >= OUTPUT_GROUP_MAX_ENTRIES) { | if (gmap[dst].m_outputs.size() >= OUTPUT_GROUP_MAX_ENTRIES) { | ||||
groups.push_back(gmap[dst]); | groups.push_back(gmap[dst]); | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |