Skip to content

Commit 0174cff

Browse files
committed
tx_builder: fix spent output index error
1 parent c249e22 commit 0174cff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/wallet/tx_builder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ std::vector<carrot::InputCandidate> collect_carrot_input_candidate_list(
303303
for (std::size_t i = 0; i < transfers.size(); ++i)
304304
{
305305
const wallet2_basic::transfer_details &td = transfers.at(i);
306-
if (best_transfer_by_ota.at(td.get_public_key()) != i)
306+
const auto best_it = best_transfer_by_ota.find(td.get_public_key());
307+
if (best_it == best_transfer_by_ota.cend() || best_it->second != i)
307308
continue;
308309

309310
if (!is_transfer_usable_for_input_selection(td,

0 commit comments

Comments
 (0)