Skip to content

Commit

Permalink
tx: make sure we return the calculated fee for callers if fees are in…
Browse files Browse the repository at this point in the history
…sufficient
  • Loading branch information
jgriffiths committed Nov 27, 2024
1 parent 2e53b69 commit 7c80c8f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ga_tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ namespace green {
// Caller requres more fee utxos to avoid dusty change
throw user_error("Fee change below the dust threshold"); // FIXME res::
}
result["fee"] = addressee.fee.value();
throw user_error("Insufficient funds for fees"); // FIXME res::
}
// Add the next input
Expand Down Expand Up @@ -762,6 +763,7 @@ namespace green {
return;
} else if (addressee.utxo_sum < addressee.required_total + addressee.fee) {
GDK_RUNTIME_ASSERT(is_policy_asset); // Fee only present for policy asset
result["fee"] = addressee.fee.value();
set_tx_error(result, "Insufficient funds for fees"); // FIXME res::
return;
}
Expand Down

0 comments on commit 7c80c8f

Please sign in to comment.