Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
config: lower outgoing htlc broadcast delta #2887
Builds on top of #2879.
We create outgoing htlcs and accept incoming htlcs within the go-to-chain window, risking triggering a force close. This PR updates the block deltas to make sure that we don't trigger a force close ourselves.
The main change is lowering the broadcast delta for outgoing htlcs. It can be lower than the delta for incoming htlcs, as we don't risk not being able to settle with the preimage if the tx(es) don't confirm in time.
The spec even suggests a delta of -1 for outgoing htlcs (https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#cltv_expiry_delta-selection). Meaning that we only go to chain in the block after the block where the htlc expires.
This PR doesn't lower it to -1, but uses 0 instead to prevent confusion around the negative number. This means that we go to chain when an outgoing htlc expires.
This PR does increase
referenced this pull request
Apr 4, 2019
Apr 6, 2019
Implemented policy check for local htlcs.
Didn't implement unit test to assert spec compliance. It doesn't look very useful to me to just check that a constant has a value. Instead I added extensive comments to the config constants which should make future devs think about what these values mean.