channel-lease: reject if we're not currently advertising liquidity

If there's no plugin currently in place, we simply won't return any
funding at all, in which case we'd expect them to handle however
they want. (our implementation would fail the open, as we only accept
opens that have at least as much as we've requested provided)
This commit is contained in:
niftynei
2021-07-06 12:17:51 -05:00
committed by neil saitug
parent d05a2a5aa9
commit 70bf57d54b
3 changed files with 15 additions and 5 deletions

View File

@@ -26,10 +26,8 @@ def test_queryrates(node_factory, bitcoind):
l2.fundwallet(amount * 10)
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
result = l1.rpc.queryrates(l2.info['id'], amount, amount * 10)
assert result['our_funding_msat'] == Millisatoshi(amount * 1000)
assert result['their_funding_msat'] == Millisatoshi(0)
assert 'weight_charge' not in result
with pytest.raises(RpcError, match=r'not advertising liquidity'):
l1.rpc.queryrates(l2.info['id'], amount, amount * 10)
l2.rpc.call('funderupdate', {'policy': 'match',
'policy_mod': 100,