-
Notifications
You must be signed in to change notification settings - Fork 412
Fix bug in check_spend_remote_htlc and let csv delays being user configurable #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in check_spend_remote_htlc and let csv delays being user configurable #355
Conversation
If you need the changes in #348 for testing, just rebase on top of it? Its close to going in anyway, just need one or two more tweaks. |
9978224
to
edee012
Compare
We were previously using their_to_self_delay to regenerate scripts for spending remote revoked htlc transactions, and that's a bug. Their_to_self_delay is delay enforced by peer upon outputs returning funds back to us. Our_to_self_delay is delay enforced by us upon outputs returning funds back to peer.
edee012
to
fe77f3e
Compare
Okay added a test for testing user configurable csv delay against hard bounds in channel constructors at fe77f3e, ready for review |
Looks like it needs rebase to pass travis? |
fe77f3e
to
1c4544a
Compare
Checked, I was already rebased on master? Dunno pushed it again |
Well it may not be a rebase error, just a build failure. |
1c4544a
to
a949d64
Compare
Oh sorry build error due to rebase error of mine! Should be good now at a949d64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly spelling mistakes, sadly.
Let these values being used as default ones in UserConfig. Also, reduce them to something more reasonable, for BREAKDOWN_TIMEOUT from 1 week to 1 day, for MAX_LOCAL_BREAKDOWN_TIMEOUT from 2 weeks to 1.
within reasonable lower or upper bound Add our_to_self_delay in Channel, to cache user config field at channel construction.
Extend test_justice_tx with user-set csv delay to test that we are able to claim revokeable outputs with different csv delay between both peers.
a949d64
to
e78c25b
Compare
Corrected on e78c25b |
Spotted while reviewing #336.
TODO: tweak a justice test on revoked HTLC outputs to check bug fix. Need test framework changes in #348 to go first.