feerate: include rough estimates of actual tx costs.

We could refine this later (based on existing wallet, for example), but
this gives some estimate.

[ Rename onchain_estimates -> onchain_fee_estimates Suggested-by: @SimonVrouwe ]
[ Factor of 1000 fix Reported-by: @SimonVrouwe ]
Suggested-by: @molxyz
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-24 11:52:48 +09:30
parent 14294642d2
commit a4b952ebc7
7 changed files with 43 additions and 4 deletions

View File

@@ -931,6 +931,11 @@ def test_feerates(node_factory):
assert feerates['sipa']['max_acceptable'] == 15000 * 10
assert feerates['sipa']['min_acceptable'] == 5000 // 2
assert len(feerates['onchain_fee_estimates']) == 3
assert feerates['onchain_fee_estimates']['opening_channel_satoshis'] == feerates['sipa']['normal'] * 702 // 1000
assert feerates['onchain_fee_estimates']['mutual_close_satoshis'] == feerates['sipa']['normal'] * 673 // 1000
assert feerates['onchain_fee_estimates']['unilateral_close_satoshis'] == feerates['sipa']['urgent'] * 598 // 1000
def test_logging(node_factory):
# Since we redirect, node.start() will fail: do manually.