Skip to content

Commit fc05354

Browse files
committed
fixup
1 parent ee287f3 commit fc05354

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/ga_tx.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ namespace sdk {
615615
amount required_total{ 0 };
616616

617617
uint32_t explicit_change_index = NO_CHANGE_INDEX;
618-
619618
if (num_addressees) {
620619
size_t addressee_index = 0;
621620
for (auto& addressee : *addressees_p) {
@@ -636,6 +635,7 @@ namespace sdk {
636635
++addressee_index;
637636
}
638637
}
638+
result["change_type"][asset_id] = explicit_change_index == NO_CHANGE_INDEX ? "generated" : "explicit";
639639

640640
// TODO: filter per asset or assume always single asset
641641
if (manual_selection) {
@@ -842,15 +842,13 @@ namespace sdk {
842842
std::swap(tx->outputs[fee_index], tx->outputs[change_index]);
843843
std::swap(fee_index, change_index);
844844
}
845-
result["change_type"][asset_id] = "generated";
846845
} else {
847846
// Use explicit change output
848847
set_tx_output_value(net_params, tx, explicit_change_index, asset_id, change_amount);
849848
auto addressees = *addressees_p;
850849
addressees[explicit_change_index]["satoshi"] = change_amount;
851850
change_index = explicit_change_index;
852851
have_change_output = true;
853-
result["change_type"][asset_id] = "explicit";
854852
}
855853

856854
result["have_change"][asset_id] = have_change_output;

0 commit comments

Comments
 (0)