Skip to content

Commit

Permalink
Fixed utils
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoZ666 committed Dec 13, 2024
1 parent 90dc7cf commit 03d3b3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn effective_value(output: &OutputGroup, feerate: f32) -> u64 {
.saturating_sub(calculate_fee(output.weight, feerate))
}

// Returns the weight of the output group(s)
/// Returns the weights of data in transaction other than the list of inputs that would be selected.
pub fn calculate_base_weight_btc(output_weight: u64) -> u64 {
// VERSION_SIZE: 4 bytes - 16 WU
// SEGWIT_MARKER_SIZE: 2 bytes - 2 WU
Expand All @@ -70,5 +70,5 @@ pub fn calculate_base_weight_btc(output_weight: u64) -> u64 {

// Total default: (16 + 2 + 4 + 4 + 1 + 16 = 43 WU + variable) WU
// Source - https://docs.rs/bitcoin/latest/src/bitcoin/blockdata/transaction.rs.html#599-602
output_weight
output_weight + 43
}

0 comments on commit 03d3b3f

Please sign in to comment.