aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_keypool.py
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-09-10 20:24:44 -0400
committerAndrew Chow <achow101-github@achow101.com>2021-10-08 13:53:48 -0400
commit0fbaef9676a1dcb84bcf95afd8d994831ab327b6 (patch)
tree4d41871f8100e99b7412983e5e7f028d15f6ecf8 /test/functional/wallet_keypool.py
parent927586990eb9bc8403a3831247847bdd3bf60423 (diff)
downloadbitcoin-0fbaef9676a1dcb84bcf95afd8d994831ab327b6.tar.xz
fees: Always round up fee calculated from a feerate
When calculating the fee for a given tx size from a fee rate, we should always round up to the next satoshi. Otherwise, if we round down (via truncation), the calculated fee may result in a fee with a feerate slightly less than targeted. This is particularly important for coin selection as a slightly lower feerate than expected can result in a variety of issues.
Diffstat (limited to 'test/functional/wallet_keypool.py')
-rwxr-xr-xtest/functional/wallet_keypool.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/wallet_keypool.py b/test/functional/wallet_keypool.py
index c714993234..ada97417e4 100755
--- a/test/functional/wallet_keypool.py
+++ b/test/functional/wallet_keypool.py
@@ -179,7 +179,7 @@ class KeyPoolTest(BitcoinTestFramework):
assert_equal("psbt" in res, True)
# create a transaction without change at the maximum fee rate, such that the output is still spendable:
- res = w2.walletcreatefundedpsbt(inputs=[], outputs=[{destination: 0.00010000}], options={"subtractFeeFromOutputs": [0], "feeRate": 0.0008824})
+ res = w2.walletcreatefundedpsbt(inputs=[], outputs=[{destination: 0.00010000}], options={"subtractFeeFromOutputs": [0], "feeRate": 0.0008823})
assert_equal("psbt" in res, True)
assert_equal(res["fee"], Decimal("0.00009706"))