X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning%2Frouting%2Frouter.rs;fp=lightning-c-bindings%2Fsrc%2Flightning%2Frouting%2Frouter.rs;h=484665971e3bf9cd2515131517bad96736410b1e;hb=3eda14ff27fcb12a0d8c8b1130af95f5f4daeccb;hp=9479bc97183fd53817c78822f83a63897ad4898d;hpb=7f9395bb7810b269a0aa5a882cc8b1b647747359;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/lightning/routing/router.rs b/lightning-c-bindings/src/lightning/routing/router.rs index 9479bc9..4846659 100644 --- a/lightning-c-bindings/src/lightning/routing/router.rs +++ b/lightning-c-bindings/src/lightning/routing/router.rs @@ -400,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 {