Skip to content

Conversation

@sirdeggen
Copy link
Contributor

Description of Changes

Parenthesis was just in the wrong place.

Linked Issues / Tickets

Closes #267

Testing Procedure

Describe the tests you've added or any testing steps you've taken.

  • I have added new unit tests
  • All tests pass locally
  • I have tested manually in my local environment
  • All tests pass when using go test ./...

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have updated CHANGELOG.md with my changes
  • I ran golangci-lint run
  • I have run go fmt and go vet one final time before requesting a review

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
transaction/broadcaster/arc.go 40.00% 5 Missing and 1 partial ⚠️
transaction/fee_model/sats_per_kb.go 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@shruggr shruggr merged commit 7f8c838 into master Nov 12, 2025
6 of 7 checks passed
@shruggr shruggr deleted the fix/feemodel branch November 12, 2025 19:45
Comment on lines 36 to 40
return (uint64(math.Ceil(float64(size)/1000)) * s.Satoshis), nil
return calculateFee(size, s.Satoshis), nil
}

func calculateFee(txSizeBytes int, satoshisPerKB uint64) uint64 {
return uint64(math.Ceil(float64(txSizeBytes) / 1000 * float64(satoshisPerKB)))
Copy link

@kuba-4chain kuba-4chain Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the fee calculation. Assuming the fee rate is 100sat/KB, if the math.Ceil() is over the entire equation, it allows for the fee to be lower than 100 sats for transactions of size lower than 1 KB. If the math.Ceil() is only over the txSizeBytes / 1000, then the fee will never be lower than 100 sats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Fee Model does not match SV Node

4 participants