Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
mappum committed Jul 21, 2023
1 parent 91d8a39 commit 3b4ed02
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 0 additions & 2 deletions rest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/bitcoin/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,13 @@ impl<'a> BuildingCheckpointMut<'a> {
out_amount += output.value;
}

let est_vsize = checkpoint_tx.vsize()? + checkpoint_tx.input.iter()?.fold(
Ok(0),
|sum: Result<u64>, input| Ok(sum? + input?.est_witness_vsize),
)?;
let est_vsize = checkpoint_tx.vsize()?
+ checkpoint_tx
.input
.iter()?
.fold(Ok(0), |sum: Result<u64>, input| {
Ok(sum? + input?.est_witness_vsize)
})?;

let fee = est_vsize * config.fee_rate;
let reserve_value = in_amount
Expand Down
4 changes: 1 addition & 3 deletions src/bitcoin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,7 @@ impl Bitcoin {
let mut checkpoint_tx = building_checkpoint_batch.get_mut(0)?.unwrap();
let input = Input::new(prevout, &sigset, dest, output.value)?;
let input_size = input.est_vsize();
checkpoint_tx
.input
.push_back(input)?;
checkpoint_tx.input.push_back(input)?;

let fee = input_size * self.checkpoints.config().fee_rate;

Expand Down

0 comments on commit 3b4ed02

Please sign in to comment.