Skip to content

Commit 8dbb366

Browse files
benthecarmanclaude
andcommitted
fixup! Change handler signatures to borrow Context
fixup! Change handler signatures to borrow Context Await unified_send directly instead of block_on Now that handlers are async, unified_send can simply .await the future instead of using block_in_place + block_on. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 40f533a commit 8dbb366

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

ldk-server/src/api/unified_send.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use ldk_node::payment::UnifiedPaymentResult;
1111
use ldk_server_grpc::api::unified_send_response::PaymentResult;
1212
use ldk_server_grpc::api::{UnifiedSendRequest, UnifiedSendResponse};
13-
use tokio::runtime::Handle;
1413

1514
use crate::api::build_route_parameters_config_from_proto;
1615
use crate::api::error::LdkServerError;
@@ -22,13 +21,11 @@ pub(crate) async fn handle_unified_send_request(
2221
) -> Result<UnifiedSendResponse, LdkServerError> {
2322
let route_parameters = build_route_parameters_config_from_proto(request.route_parameters)?;
2423

25-
let result = tokio::task::block_in_place(|| {
26-
Handle::current().block_on(context.node.unified_payment().send(
27-
&request.uri,
28-
request.amount_msat,
29-
route_parameters,
30-
))
31-
})?;
24+
let result = context
25+
.node
26+
.unified_payment()
27+
.send(&request.uri, request.amount_msat, route_parameters)
28+
.await?;
3229

3330
let payment_result = match result {
3431
UnifiedPaymentResult::Onchain { txid } => PaymentResult::Txid(txid.to_string()),

0 commit comments

Comments
 (0)