Mark ChannelManager::send_payment_with_route as deprecated and take Route
by value
#3224
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.
We probably should have done this long ago a release or two after
adding
send_payment
, but we didn't and the second best time isnow.
send_payment_with_route
has particularly hard to use retrysemantics that make it unsuitable for real use. Once we get the
last of our users off of it, we'll want to remove it (or at least
mark it test-only), but we should start by deprecating it.
Now that
ChannelManager::send_payment_with_route
is deprecated,we don't care too much about making it as effecient as possible, so
there's not much cost to making it take
Route
by value. Thisavoids bindings being unsure if the by-reference
Route
passedneeds to outlive the
ChannelManager
itself or if it only needs tooutlive the method call, creating some call overhead by forcing a
Route::clone
, but avoiding a memory leak.