Update auto-generated bindings for LDK 0.0.115
[ldk-c-bindings] / lightning-c-bindings / src / lightning / chain / chaininterface.rs
index 2c1d281f2a10ce6e82dac5191ffc8f09d2c12dd4..687262be8a16c16be001fbaf1b813233cb382888 100644 (file)
@@ -135,6 +135,15 @@ pub extern "C" fn ConfirmationTarget_normal() -> ConfirmationTarget {
 /// Utility method to constructs a new HighPriority-variant ConfirmationTarget
 pub extern "C" fn ConfirmationTarget_high_priority() -> ConfirmationTarget {
        ConfirmationTarget::HighPriority}
+/// Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
+#[no_mangle]
+pub extern "C" fn ConfirmationTarget_hash(o: &ConfirmationTarget) -> u64 {
+       // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
+       #[allow(deprecated)]
+       let mut hasher = core::hash::SipHasher::new();
+       core::hash::Hash::hash(&o.to_native(), &mut hasher);
+       core::hash::Hasher::finish(&hasher)
+}
 /// Checks if two ConfirmationTargets contain equal inner contents.
 /// This ignores pointers and is_owned flags and looks at the values in fields.
 #[no_mangle]