Fix BTC witness size estimate.

This commit is contained in:
tecnovert
2023-07-14 09:31:05 +02:00
parent 705ac2c6fc
commit 7bc5fc78ba
12 changed files with 143 additions and 54 deletions

View File

@@ -95,7 +95,7 @@ class PIVXInterface(BTCInterface):
def getBLockSpendTxFee(self, tx, fee_rate: int) -> int:
add_bytes = 107
size = len(tx.serialize_with_witness()) + add_bytes
pay_fee = int(fee_rate * size // 1000)
pay_fee = round(fee_rate * size / 1000)
self._log.info(f'BLockSpendTx fee_rate, size, fee: {fee_rate}, {size}, {pay_fee}.')
return pay_fee