EXPERIMENTAL_FEATURES: enable option_anchor_outputs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-08-14 11:00:42 +09:30
parent 591e8f9663
commit cbd0be5c0e
6 changed files with 62 additions and 9 deletions

View File

@@ -627,11 +627,30 @@ def test_sendpay_cant_afford(node_factory):
with pytest.raises(RpcError):
l1.pay(l2, 10**9 + 1)
# This is the fee, which needs to be taken into account for l1.
available = 10**9 - 32040000
# Reserve is 1%.
reserve = 10**7
# # This is how we recalc constants (v. v. slow!)
# minimum = 1
# maximum = 10**9
# while maximum - minimum > 1:
# l1, l2 = node_factory.line_graph(2, fundamount=10**6,
# opts={'feerates': (15000, 15000, 15000, 15000)})
# try:
# l1.pay(l2, (minimum + maximum) // 2)
# minimum = (minimum + maximum) // 2
# except RpcError:
# maximum = (minimum + maximum) // 2
# print("{} - {}".format(minimum, maximum))
# assert False
# This is the fee, which needs to be taken into account for l1.
if EXPERIMENTAL_FEATURES:
# option_anchor_outputs
available = 10**9 - 44700000
else:
available = 10**9 - 32040000
# Can't pay past reserve.
with pytest.raises(RpcError):
l1.pay(l2, available)