Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
jkauffman1 committed May 25, 2021
1 parent ee287f3 commit fc05354
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/ga_tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ namespace sdk {
amount required_total{ 0 };

uint32_t explicit_change_index = NO_CHANGE_INDEX;

if (num_addressees) {
size_t addressee_index = 0;
for (auto& addressee : *addressees_p) {
Expand All @@ -636,6 +635,7 @@ namespace sdk {
++addressee_index;
}
}
result["change_type"][asset_id] = explicit_change_index == NO_CHANGE_INDEX ? "generated" : "explicit";

// TODO: filter per asset or assume always single asset
if (manual_selection) {
Expand Down Expand Up @@ -842,15 +842,13 @@ namespace sdk {
std::swap(tx->outputs[fee_index], tx->outputs[change_index]);
std::swap(fee_index, change_index);
}
result["change_type"][asset_id] = "generated";
} else {
// Use explicit change output
set_tx_output_value(net_params, tx, explicit_change_index, asset_id, change_amount);
auto addressees = *addressees_p;
addressees[explicit_change_index]["satoshi"] = change_amount;
change_index = explicit_change_index;
have_change_output = true;
result["change_type"][asset_id] = "explicit";
}

result["have_change"][asset_id] = have_change_output;
Expand Down

0 comments on commit fc05354

Please sign in to comment.