Skip to content

Commit 335931d

Browse files
committed
rpc: return a number for estimated_feerate in analyzepsbt
1 parent a4d0fd0 commit 335931d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,7 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
20212021
result.pushKV("estimated_vsize", (int)size);
20222022
// Estimate fee rate
20232023
CFeeRate feerate(fee, size);
2024-
result.pushKV("estimated_feerate", feerate.ToString());
2024+
result.pushKV("estimated_feerate", ValueFromAmount(feerate.GetFeePerK()));
20252025
}
20262026
result.pushKV("fee", ValueFromAmount(fee));
20272027

test/functional/rpc_psbt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def run_test(self):
355355
assert analyzed['inputs'][0]['has_utxo'] and not analyzed['inputs'][0]['is_final'] and analyzed['inputs'][0]['next'] == 'signer' and analyzed['next'] == 'signer' and analyzed['inputs'][0]['missing']['signatures'][0] == addrinfo['embedded']['witness_program']
356356

357357
# Check fee and size things
358-
assert analyzed['fee'] == Decimal('0.001') and analyzed['estimated_vsize'] == 134 and analyzed['estimated_feerate'] == '0.00746268 BTC/kB'
358+
assert analyzed['fee'] == Decimal('0.001') and analyzed['estimated_vsize'] == 134 and analyzed['estimated_feerate'] == Decimal('0.00746268')
359359

360360
# After signing and finalizing, needs extracting
361361
signed = self.nodes[1].walletprocesspsbt(updated)['psbt']

0 commit comments

Comments
 (0)