diff options
| author | Suhas Daftuar <[email protected]> | 2018-07-30 10:43:16 -0400 |
|---|---|---|
| committer | Suhas Daftuar <[email protected]> | 2018-07-30 10:43:16 -0400 |
| commit | 57ec1c97b2d0c0ba6056a43fa4177efc39567ae2 (patch) | |
| tree | 137303f466d826baa20969b08589510204a23b9a /src/wallet/wallet.cpp | |
| parent | doc: Add historical release notes for 0.16.2 (diff) | |
| download | discoin-57ec1c97b2d0c0ba6056a43fa4177efc39567ae2.tar.xz discoin-57ec1c97b2d0c0ba6056a43fa4177efc39567ae2.zip | |
[wallet] correctly limit output group size
Diffstat (limited to 'src/wallet/wallet.cpp')
| -rw-r--r-- | src/wallet/wallet.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4918100b3..ebf09a951 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4423,7 +4423,10 @@ std::vector<OutputGroup> CWallet::GroupOutputs(const std::vector<COutput>& outpu size_t ancestors, descendants; mempool.GetTransactionAncestry(output.tx->GetHash(), ancestors, descendants); 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]); gmap.erase(dst); } |