Browse Source
Merge pull request #3879 from SomberNight/fee_calc_integer_satbyte
fee calculation: force back-end to use integer sat/bytes
3.1
ThomasV
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
1 deletions
-
lib/simple_config.py
|
@ -428,7 +428,12 @@ class SimpleConfig(PrintError): |
|
|
|
|
|
|
|
|
@classmethod |
|
|
@classmethod |
|
|
def estimate_fee_for_feerate(cls, fee_per_kb, size): |
|
|
def estimate_fee_for_feerate(cls, fee_per_kb, size): |
|
|
return int(fee_per_kb * size / 1000.) |
|
|
# note: We only allow integer sat/byte values atm. |
|
|
|
|
|
# The GUI for simplicity reasons only displays integer sat/byte, |
|
|
|
|
|
# and for the sake of consistency, we thus only use integer sat/byte in |
|
|
|
|
|
# the backend too. |
|
|
|
|
|
fee_per_byte = int(fee_per_kb / 1000) |
|
|
|
|
|
return int(fee_per_byte * size) |
|
|
|
|
|
|
|
|
def update_fee_estimates(self, key, value): |
|
|
def update_fee_estimates(self, key, value): |
|
|
self.fee_estimates[key] = value |
|
|
self.fee_estimates[key] = value |
|
|