[wallet] correctly limit output group size
This commit is contained in:
parent
222e627322
commit
57ec1c97b2
1 changed files with 4 additions and 1 deletions
|
@ -4423,7 +4423,10 @@ std::vector<OutputGroup> CWallet::GroupOutputs(const std::vector<COutput>& outpu
|
||||||
size_t ancestors, descendants;
|
size_t ancestors, descendants;
|
||||||
mempool.GetTransactionAncestry(output.tx->GetHash(), ancestors, descendants);
|
mempool.GetTransactionAncestry(output.tx->GetHash(), ancestors, descendants);
|
||||||
if (!single_coin && ExtractDestination(output.tx->tx->vout[output.i].scriptPubKey, dst)) {
|
if (!single_coin && ExtractDestination(output.tx->tx->vout[output.i].scriptPubKey, dst)) {
|
||||||
if (gmap.count(dst) == 10) {
|
// Limit output groups to no more than 10 entries, to protect
|
||||||
|
// against inadvertently creating a too-large transaction
|
||||||
|
// when using -avoidpartialspends
|
||||||
|
if (gmap[dst].m_outputs.size() >= 10) {
|
||||||
groups.push_back(gmap[dst]);
|
groups.push_back(gmap[dst]);
|
||||||
gmap.erase(dst);
|
gmap.erase(dst);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue