Skip to content

Commit

Permalink
Rename variables for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGould committed Nov 20, 2024
1 parent b404a91 commit 3a54a34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions payjoin/src/receive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ impl WantsInputs {
&self,
candidate_inputs: impl IntoIterator<Item = InputPair>,
) -> Result<InputPair, SelectionError> {
let min_original_out_sats = self
let min_out_sats = self
.payjoin_psbt
.unsigned_tx
.output
Expand All @@ -532,7 +532,7 @@ impl WantsInputs {
.min()
.unwrap_or(Amount::MAX_MONEY);

let min_original_in_sats = self
let min_in_sats = self
.payjoin_psbt
.input_pairs()
.filter_map(|input| input.previous_txout().ok().map(|txo| txo.value))
Expand All @@ -543,8 +543,8 @@ impl WantsInputs {

for input_pair in candidate_inputs {
let candidate_sats = input_pair.previous_txout().value;
let candidate_min_out = min(min_original_out_sats, prior_payment_sats + candidate_sats);
let candidate_min_in = min(min_original_in_sats, candidate_sats);
let candidate_min_out = min(min_out_sats, prior_payment_sats + candidate_sats);
let candidate_min_in = min(min_in_sats, candidate_sats);

if candidate_min_in > candidate_min_out {
// The candidate avoids UIH2 but conforms to UIH1: Optimal change heuristic.
Expand Down

0 comments on commit 3a54a34

Please sign in to comment.