Skip to content

Commit

Permalink
Merge dashpay#6305: backport: Merge bitcoin#24434, 23136
Browse files Browse the repository at this point in the history
379aefa Merge bitcoin#24434: Add missed word to error message (laanwj)
5187ec0 Merge bitcoin#23136: test: update fee rate assertion helper in the functional test framework (MarcoFalke)

Pull request description:

  bitcoin backports

ACKs for top commit:
  knst:
    utACK 379aefa
  PastaPastaPasta:
    utACK 379aefa

Tree-SHA512: c61e295f9543878fa7a56dcb42cebb740cf1d38ae870f8ec78bbbb0dd643713e6415d6bd14bbdaeba61a2be8eaa8c4648edc76754b6f32cc89845af9ed8ca994
  • Loading branch information
PastaPastaPasta committed Nov 26, 2024
2 parents 1155ff2 + 379aefa commit 8a05f0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4353,7 +4353,7 @@ bool CConnman::Start(CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_met
if (connOptions.m_use_addrman_outgoing && !connOptions.m_specified_outgoing.empty()) {
if (clientInterface) {
clientInterface->ThreadSafeMessageBox(
_("Cannot provide specific connections and have addrman find outgoing connections at the same."),
_("Cannot provide specific connections and have addrman find outgoing connections at the same time."),
"", CClientUIInterface::MSG_ERROR);
}
return false;
Expand Down
9 changes: 5 additions & 4 deletions test/functional/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ def assert_approx(v, vexp, vspan=0.00001):
raise AssertionError("%s > [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan)))


def assert_fee_amount(fee, tx_size, fee_per_kB):
"""Assert the fee was in range"""
target_fee = round(tx_size * fee_per_kB / 1000, 8)
def assert_fee_amount(fee, tx_size, feerate_DASH_kvB):
"""Assert the fee is in range."""
feerate_DASH_vB = feerate_DASH_kvB / 1000
target_fee = satoshi_round(tx_size * feerate_DASH_vB)
if fee < target_fee:
raise AssertionError("Fee of %s DASH too low! (Should be %s DASH)" % (str(fee), str(target_fee)))
# allow the wallet's estimation to be at most 2 bytes off
if fee > (tx_size + 2) * fee_per_kB / 1000:
if fee > (tx_size + 2) * feerate_DASH_vB:
raise AssertionError("Fee of %s DASH too high! (Should be %s DASH)" % (str(fee), str(target_fee)))


Expand Down

0 comments on commit 8a05f0c

Please sign in to comment.