From 6cb1ad1fa2d6f060b39556fc3e82a1d4551c081a Mon Sep 17 00:00:00 2001 From: stoffu Date: Tue, 9 May 2017 11:54:21 +0900 Subject: [PATCH] wallet fix: ensure iterator to be valid --- src/wallet/wallet2.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 9069789c..b3e9143e 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -4266,7 +4266,10 @@ std::vector wallet2::create_transactions_2(std::vector::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