| 873 | } |
| 874 | |
| 875 | fn hook_fallback(hookname: &str) -> Option<serde_json::Value> { |
| 876 | match hookname { |
| 877 | "htlc_accepted" => Some(json!({ |
| 878 | "result": "fail", |
| 879 | "failure_message": "2002" |
| 880 | })), |
| 881 | "peer_connected" |
| 882 | | "invoice_payment" |
| 883 | | "rpc_command" |
| 884 | | "custommsg" |
| 885 | | "onion_message_recv" |
| 886 | | "onion_message_recv_secret" |
| 887 | | "recover" => Some(json!({"result": "continue"})), |
| 888 | "openchannel" |
| 889 | | "openchannel2" |
| 890 | | "openchannel2_changed" |
| 891 | | "openchannel2_sign" |
| 892 | | "rbf_channel" => Some(json!({"result": "reject"})), |
| 893 | // commitment_revocation and db_write cannot recover from failing, let lightningd crash |
| 894 | _ => None, |
| 895 | } |
| 896 | } |
| 897 | |
| 898 | impl<S> PluginDriver<S> |
| 899 | where |