aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2022-12-07 17:33:13 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2022-12-07 17:33:37 +0100
commit9052d869c9679d997931084384c026450c2d918b (patch)
tree02e565c1ee21116669ab90e08ab5a80ae738fcc9 /test/functional
parent7d515600034b84ebf23346a3642cf0a714880e25 (diff)
parent6fb102c9f361a7ba0a6aa0a9b41315f5e04559f7 (diff)
Merge bitcoin/bitcoin#26517: test: Changed small_txpuzzle_randfee to return the virtual size instead of the transaction hex for feerate calculation.
6fb102c9f361a7ba0a6aa0a9b41315f5e04559f7 test: Changed small_txpuzzle_randfee to return the virtual size instead of the transaction hex for feerate calculation. (Randall Naar) Pull request description: The fee rates used in feature_fee_estimation.py are calculated using the raw transaction size instead of the virtual transaction size (which is used in 'CBlockPolicyEstimator::processBlockTx' and 'CBlockPolicyEstimator::processBlock'). This leads to inconsistencies as the fee rates used in check_raw_estimates are incorrect and can cause assertions to fail. refs #25179 ACKs for top commit: MarcoFalke: ACK 6fb102c9f361a7ba0a6aa0a9b41315f5e04559f7 Tree-SHA512: b2bca85fffa605aeb17574f050736d4556506d782dd7fd969e165e48e108fd95ef4c4e2abbae83cce05ca777a00f4459cabfa0932694fa8bb93ddfba09d84357
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/feature_fee_estimation.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/functional/feature_fee_estimation.py b/test/functional/feature_fee_estimation.py
index b0cbcf4edf..0357a6f281 100755
--- a/test/functional/feature_fee_estimation.py
+++ b/test/functional/feature_fee_estimation.py
@@ -62,7 +62,7 @@ def small_txpuzzle_randfee(
unconflist.append({"txid": txid, "vout": 0, "value": total_in - amount - fee})
unconflist.append({"txid": txid, "vout": 1, "value": amount})
- return (tx.serialize().hex(), fee)
+ return (tx.get_vsize(), fee)
def check_raw_estimates(node, fees_seen):
@@ -158,7 +158,7 @@ class EstimateFeeTest(BitcoinTestFramework):
random.shuffle(self.confutxo)
for _ in range(random.randrange(100 - 50, 100 + 50)):
from_index = random.randint(1, 2)
- (txhex, fee) = small_txpuzzle_randfee(
+ (tx_bytes, fee) = small_txpuzzle_randfee(
self.wallet,
self.nodes[from_index],
self.confutxo,
@@ -167,7 +167,7 @@ class EstimateFeeTest(BitcoinTestFramework):
min_fee,
min_fee,
)
- tx_kbytes = (len(txhex) // 2) / 1000.0
+ tx_kbytes = tx_bytes / 1000.0
self.fees_per_kb.append(float(fee) / tx_kbytes)
self.sync_mempools(wait=0.1)
mined = mining_node.getblock(self.generate(mining_node, 1)[0], True)["tx"]