Skip to content

Commit

Permalink
Don't calculate premine output twice.
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Mar 18, 2024
1 parent 736e6c3 commit 8aabc32
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/wallet/inscribe/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ impl Batch {
premine = etch.premine.to_amount(etch.divisibility)?;

if premine > 0 {
vout = Some(u32::try_from(reveal_outputs.len()).unwrap());
let output = u32::try_from(reveal_outputs.len()).unwrap();
destination = Some(reveal_change.clone());

reveal_outputs.push(TxOut {
Expand All @@ -446,13 +446,10 @@ impl Batch {
edicts.push(Edict {
id: 0,
amount: premine,
output: reveal_outputs
.len()
.checked_sub(1)
.unwrap()
.try_into()
.unwrap(),
output: output.into(),
});

vout = Some(output);
} else {
vout = None;
destination = None;
Expand Down

0 comments on commit 8aabc32

Please sign in to comment.