/**
- * A channel_update message to be sent or received from a peer
+ * A [`channel_update`] message to be sent to or received from a peer.
+ *
+ * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class ChannelUpdate extends CommonBase {
return ret_hu_conv;
}
+ /**
+ * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
+ */
+ public long hash() {
+ long ret = bindings.ChannelUpdate_hash(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two ChannelUpdates contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.