aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2017-05-09 11:54:21 +0900
committerstoffu <stoffu@protonmail.ch>2017-05-09 11:54:21 +0900
commit6cb1ad1fa2d6f060b39556fc3e82a1d4551c081a (patch)
tree5dcbb29b8c57dd71a7de38f00548ca8c45fe2765 /src/wallet/wallet2.cpp
parentMerge pull request #2015 (diff)
downloadmonero-6cb1ad1fa2d6f060b39556fc3e82a1d4551c081a.tar.xz
wallet fix: ensure iterator to be valid
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 9069789ca..b3e9143e4 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