Skip to content

Optimize some ChannelMonitor stuff after #163 - #177

Merged
TheBlueMatt merged 3 commits into
lightningdevkit:masterfrom
TheBlueMatt:2018-09-163-cleanups
Sep 14, 2018
Merged

TheBlueMatt merged 3 commits into
lightningdevkit:masterfrom
TheBlueMatt:2018-09-163-cleanups

Conversation

@TheBlueMatt

Copy link
Copy Markdown
Collaborator

A few things are cleanups of #163, and a few further optimizations I found during review. The tests were super confusing as they were so I went back and wrote documentation for the old stuff, which convinced me the new tests didn't really fit in the function they were in as they dont depend on a commitment transaction so are probably better suited to their own function.

Instead of hopping a pointer, we're only ever going to return one
Transaction at max, so skip the Vec. Also avoid
re-pubkey-converting the revocation key.
This lets us simplify a few tidbits of loop.
This effecitlvey reverts the refactors in 383bd90,
however keeps the actully new test code.

It also writes documentation for the super confusing tx test func
and makes it a bit less permissive.
@ariard

ariard commented Sep 13, 2018

Copy link
Copy Markdown

utACK, but for lacking tests as described in #137 (comment), I still put them in channel_monitor_network_test ?

@TheBlueMatt

Copy link
Copy Markdown
Collaborator Author

Doesn't matter too much, some of our tests are already a bit slow, especially on platforms that are more sensitive to non-optimized binaries, so may make sense to split it up and create a new test function for additional tests if they add too much runtime (cause they get run in paralell). I just split up test_txn_broadcast cause the new additions didn't really have anything to do with the other stuff there (which was all about spending a commitment tx).

@TheBlueMatt
TheBlueMatt merged commit e323c13 into lightningdevkit:master Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants