mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
funder: default to only funding leases
Make the default to only lease out funds. Changelog-Changed: funder plugin defaults to leases-only
This commit is contained in:
2
external/lnprototest
vendored
2
external/lnprototest
vendored
Submodule external/lnprototest updated: ff3750b0ce...2b99492ed0
@@ -95,9 +95,7 @@ default_funder_policy(const tal_t *ctx,
|
||||
0, /* fuzz_factor */
|
||||
AMOUNT_SAT(0), /* reserve_tank */
|
||||
100,
|
||||
/* Defaults to true iif we're advertising
|
||||
* offers */
|
||||
false,
|
||||
true, /* Leases-only by default */
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -489,7 +489,7 @@ int main(int argc, const char *argv[])
|
||||
AMOUNT_SAT(50000),
|
||||
AMOUNT_SAT(50000),
|
||||
AMOUNT_SAT(100000),
|
||||
AMOUNT_SAT(0),
|
||||
AMOUNT_SAT(100000),
|
||||
&our_funds);
|
||||
assert(amount_sat_eq(empty, our_funds));
|
||||
assert(!err);
|
||||
|
||||
@@ -857,7 +857,8 @@ def test_channel_lease_unilat_closes(node_factory, bitcoind):
|
||||
l2-l3: l2 leases funds from l3; l3 goes to chain unilaterally
|
||||
'''
|
||||
opts = {'funder-policy': 'match', 'funder-policy-mod': 100,
|
||||
'lease-fee-base-msat': '100sat', 'lease-fee-basis': 100}
|
||||
'lease-fee-base-msat': '100sat', 'lease-fee-basis': 100,
|
||||
'funder-lease-requests-only': False}
|
||||
|
||||
l1, l2, l3 = node_factory.get_nodes(3, opts=opts)
|
||||
# Allow l2 some warnings
|
||||
|
||||
@@ -410,7 +410,8 @@ def test_disconnect_fundee_v2(node_factory):
|
||||
l2 = node_factory.get_node(disconnect=disconnects,
|
||||
options={'funder-policy': 'match',
|
||||
'funder-policy-mod': 100,
|
||||
'funder-fuzz-percent': 0})
|
||||
'funder-fuzz-percent': 0,
|
||||
'funder-lease-requests-only': False})
|
||||
|
||||
l1.fundwallet(2000000)
|
||||
l2.fundwallet(2000000)
|
||||
@@ -1687,10 +1688,12 @@ def test_multifunding_v2_exclusive(node_factory, bitcoind):
|
||||
options = [{},
|
||||
{'funder-policy': 'match',
|
||||
'funder-policy-mod': 100,
|
||||
'funder-fuzz-percent': 0},
|
||||
'funder-fuzz-percent': 0,
|
||||
'funder-lease-requests-only': False},
|
||||
{'funder-policy': 'match',
|
||||
'funder-policy-mod': 100,
|
||||
'funder-fuzz-percent': 0},
|
||||
'funder-fuzz-percent': 0,
|
||||
'funder-lease-requests-only': False},
|
||||
{}]
|
||||
l1, l2, l3, l4 = node_factory.get_nodes(4, opts=options)
|
||||
|
||||
|
||||
@@ -1047,6 +1047,7 @@ def test_funder_options(node_factory, bitcoind):
|
||||
assert funder_opts['reserve_tank_msat'] == Millisatoshi('0msat')
|
||||
assert funder_opts['fuzz_percent'] == 0
|
||||
assert funder_opts['fund_probability'] == 100
|
||||
assert funder_opts['leases_only']
|
||||
|
||||
# l2 funds a chanenl with us. We don't contribute
|
||||
l2.rpc.connect(l1.info['id'], 'localhost', l1.port)
|
||||
@@ -1066,7 +1067,8 @@ def test_funder_options(node_factory, bitcoind):
|
||||
'per_channel_max_msat': '10000000000msat',
|
||||
'reserve_tank_msat': '3000000msat',
|
||||
'fund_probability': 99,
|
||||
'fuzz_percent': 0})
|
||||
'fuzz_percent': 0,
|
||||
'leases_only': False})
|
||||
|
||||
assert funder_opts['policy'] == 'available'
|
||||
assert funder_opts['policy_mod'] == 100
|
||||
@@ -1126,7 +1128,8 @@ def test_funder_contribution_limits(node_factory, bitcoind):
|
||||
'min_their_funding_msat': '1000msat',
|
||||
'per_channel_min_msat': '1000000msat',
|
||||
'fund_probability': 100,
|
||||
'fuzz_percent': 0})
|
||||
'fuzz_percent': 0,
|
||||
'leases_only': False})
|
||||
|
||||
# Set our contribution to 50k sat, should only use 7 of 12 available utxos
|
||||
l3.rpc.call('funderupdate',
|
||||
@@ -1136,7 +1139,8 @@ def test_funder_contribution_limits(node_factory, bitcoind):
|
||||
'per_channel_min_msat': '1000sat',
|
||||
'per_channel_max_msat': '500000sat',
|
||||
'fund_probability': 100,
|
||||
'fuzz_percent': 0})
|
||||
'fuzz_percent': 0,
|
||||
'leases_only': False})
|
||||
|
||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
||||
l1.fundchannel(l2, 10**7)
|
||||
|
||||
Reference in New Issue
Block a user