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,