Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallet subsystem transaction generator updates #400

Merged
merged 19 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change aggregate input value check to use saturating_sub() to prevent…
… potential overflows (re github feedback)
  • Loading branch information
aspect committed Jan 23, 2024
commit 4e53676e116b83cd966ba1782fa4a423f978a36b
2 changes: 1 addition & 1 deletion wallet/core/src/tx/generator/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ impl Generator {
|| (self.inner.final_transaction_priority_fee.sender_pays()
&& stage.aggregate_input_value >= final_transaction.value_with_priority_fee)
|| (self.inner.final_transaction_priority_fee.receiver_pays()
&& stage.aggregate_input_value >= final_transaction.value_no_fees - context.aggregate_fees)
&& stage.aggregate_input_value >= final_transaction.value_no_fees.saturating_sub(context.aggregate_fees))
{
if let Some(kind) = self.try_finish_standard_stage_processing(context, stage, &mut data, final_transaction)? {
return Ok((kind, data));
Expand Down