From 69052b2adba6c006e6929afda27f041a427f58f8 Mon Sep 17 00:00:00 2001 From: arkanoider <113362043+arkanoider@users.noreply.github.com> Date: Fri, 8 Nov 2024 13:59:45 +0100 Subject: [PATCH] Some other removal of request_id (#387) --- src/app/add_invoice.rs | 5 ++++- src/app/cancel.rs | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/add_invoice.rs b/src/app/add_invoice.rs index 413e9c4..f928bd2 100644 --- a/src/app/add_invoice.rs +++ b/src/app/add_invoice.rs @@ -19,8 +19,11 @@ pub async fn add_invoice_action( my_keys: &Keys, pool: &Pool, ) -> Result<()> { + // Get the order message let order_msg = msg.get_inner_message_kind(); - let request_id = msg.get_inner_message_kind().request_id; + // Get the request id + let request_id = order_msg.request_id; + // Get the order let mut order = if let Some(order_id) = order_msg.id { match Order::by_id(pool, order_id).await? { Some(order) => order, diff --git a/src/app/cancel.rs b/src/app/cancel.rs index 637fd5b..c520d29 100644 --- a/src/app/cancel.rs +++ b/src/app/cancel.rs @@ -136,7 +136,7 @@ pub async fn cancel_action( .await; let counterparty_pubkey = PublicKey::from_str(&counterparty_pubkey)?; send_new_order_msg( - request_id, + None, Some(order.id), Action::CooperativeCancelAccepted, None, @@ -161,7 +161,7 @@ pub async fn cancel_action( .await; let counterparty_pubkey = PublicKey::from_str(&counterparty_pubkey)?; send_new_order_msg( - request_id, + None, Some(order.id), Action::CooperativeCancelInitiatedByPeer, None, @@ -215,7 +215,7 @@ pub async fn cancel_add_invoice( ) .await; send_new_order_msg( - request_id, + None, Some(order.id), Action::Canceled, None, @@ -284,7 +284,7 @@ pub async fn cancel_pay_hold_invoice( ) .await; send_new_order_msg( - request_id, + None, Some(order.id), Action::Canceled, None,