Skip to content

Commit

Permalink
plugin: Do not panic when we can't decode the invoice_payment payload
Browse files Browse the repository at this point in the history
Just patching this one over for now until we find the root cause.
  • Loading branch information
cdecker committed Jun 5, 2024
1 parent 111b1cf commit c244ddf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions libs/gl-plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,19 @@ fn _parse_gl_config_from_serialized_request(request: String) -> Option<pb::GlCon
}
}


/// Notification handler that receives notifications on incoming
/// payments, then looks up the invoice in the DB, and forwards the
/// full information to the GRPC interface.
async fn on_invoice_payment(plugin: Plugin, v: serde_json::Value) -> Result<serde_json::Value> {
debug!("Got an incoming payment via invoice_payment: {:?}", v);
log::info!("Got an incoming payment via invoice_payment: {:?}", v);
let state = plugin.state();
let call: messages::InvoicePaymentCall = serde_json::from_value(v).unwrap();
let call: messages::InvoicePaymentCall = match serde_json::from_value(v) {
Ok(v) => v,
Err(e) => {
log::error!("Could not decode the invoice_payment_call: {e}");
return Ok(json!({"result": "continue"}));
}
};

let rpc = state.rpc.lock().await.clone();
let req = requests::ListInvoices {
Expand Down

0 comments on commit c244ddf

Please sign in to comment.