835b04d5c6
This was already implicitly checked. This diff makes the check explicit, and serves as an additional sanity-check.
- for client-forward-swaps, we have
- "cltv safety requirement: (onchain_locktime < LN_locktime), otherwise client is vulnerable"
- server chooses onchain locktime delta = 70
https://github.com/spesmilo/electrum/blob/71255c1e735cdfcd881e045b9f2f6bc6b599f459/electrum/submarine_swaps.py#L701
- client checks that onchain locktime delta is <100
https://github.com/spesmilo/electrum/blob/71255c1e735cdfcd881e045b9f2f6bc6b599f459/electrum/submarine_swaps.py#L887
- client chooses LN locktime delta = 432
https://github.com/spesmilo/electrum/blob/71255c1e735cdfcd881e045b9f2f6bc6b599f459/electrum/submarine_swaps.py#L907
- for client-reverse-swaps, we have
- "cltv safety requirement: (onchain_locktime < LN_locktime), otherwise server is vulnerable"
- server chooses onchain locktime delta = 70
https://github.com/spesmilo/electrum/blob/71255c1e735cdfcd881e045b9f2f6bc6b599f459/electrum/submarine_swaps.py#L598
- server chooses LN locktime delta: unset, i.e. our default of 147
https://github.com/spesmilo/electrum/blob/71255c1e735cdfcd881e045b9f2f6bc6b599f459/electrum/submarine_swaps.py#L612
https://github.com/spesmilo/electrum/blob/71255c1e735cdfcd881e045b9f2f6bc6b599f459/electrum/lnworker.py#L2273