Update auto-generated bindings to match latest upstream
[ldk-c-bindings] / lightning-c-bindings / src / lightning / routing / router.rs
index 5a060c107bed13b6915120aa454c8bc40a41ef06..484665971e3bf9cd2515131517bad96736410b1e 100644 (file)
@@ -11,6 +11,7 @@
 //! You probably want to create a NetGraphMsgHandler and use that as your RoutingMessageHandler and then
 //! interrogate it to get routes for your own payments.
 
+use std::str::FromStr;
 use std::ffi::c_void;
 use bitcoin::hashes::Hash;
 use crate::c_types::*;
@@ -399,6 +400,15 @@ pub extern "C" fn RouteHintHop_new(mut src_node_id_arg: crate::c_types::PublicKe
                htlc_maximum_msat: local_htlc_maximum_msat_arg,
        })), is_owned: true }
 }
+/// Checks if two RouteHintHops contain equal inner contents.
+/// This ignores pointers and is_owned flags and looks at the values in fields.
+/// Two objects with NULL inner values will be considered "equal" here.
+#[no_mangle]
+pub extern "C" fn RouteHintHop_eq(a: &RouteHintHop, b: &RouteHintHop) -> bool {
+       if a.inner == b.inner { return true; }
+       if a.inner.is_null() || b.inner.is_null() { return false; }
+       if unsafe { &*a.inner } == unsafe { &*b.inner } { true } else { false }
+}
 impl Clone for RouteHintHop {
        fn clone(&self) -> Self {
                Self {