Use LDK ChannelManager for OfferMessageHandler #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #14
I would like to address this issue before working on updating to ldk v0.0.125. During my work to update ldk to v0.0125, I have got many conflicts. Cutoff codes by using the default implementation make it easy to resolve conflicts.
LDK ChannelManager now implements OfferMessageHandler. So we can use the default SimpleArcOnionMessenger as the OnionMessenger type.
This change doesn't work with the current lndk integration tests. In this PR we are going to use
channel_manager.create_offer_builder()
to create an offer. However, this method throws an error if it can't find a peer with more than 3 channels. In lndk integration test, the peer has one channel because the network is really simple. This causes test to fail. To test passed, we can implement a custom MessageRouter (because the restriction is implemented by defaultMessageRouter) or add more channels to the peer. I think the latter is simple and sufficient for here. I have confirmed that the latter works fine with this PR. New test looks like this.