diff options
| author | Riccardo Spagni <ric@spagni.net> | 2017-05-30 21:14:24 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2017-05-30 21:14:24 +0200 |
| commit | 024860b49dc66d4feefd45a299e3de7a4f5065b7 (patch) | |
| tree | 1c8ef85c9dc6a7dd797dfc160f2a51733cd36999 /src/wallet/wallet2.cpp | |
| parent | 1555e7673d994cacd3f845cc923db40795a26219 (diff) | |
| parent | 6cb1ad1fa2d6f060b39556fc3e82a1d4551c081a (diff) | |
| download | monzero-core-024860b49dc66d4feefd45a299e3de7a4f5065b7.tar.gz monzero-core-024860b49dc66d4feefd45a299e3de7a4f5065b7.tar.xz monzero-core-024860b49dc66d4feefd45a299e3de7a4f5065b7.zip | |
Merge pull request #2020
6cb1ad1f wallet fix: ensure iterator to be valid (stoffu)
Diffstat (limited to 'src/wallet/wallet2.cpp')
| -rw-r--r-- | src/wallet/wallet2.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 691d5137f..50d0c1560 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -4266,7 +4266,10 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp std::vector<cryptonote::tx_destination_entry>::iterator i; i = std::find_if(dsts.begin(), dsts.end(), [&](const cryptonote::tx_destination_entry &d) { return !memcmp (&d.addr, &addr, sizeof(addr)); }); if (i == dsts.end()) + { dsts.push_back(tx_destination_entry(0,addr)); + i = dsts.end() - 1; + } i->amount += amount; } else |
