X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FNodeId.java;h=830cfdc322e07c2da8fe6258a051e27dedde7faa;hb=2bb592fb946e316dba9f4d1123f8ac72ff4e9bf8;hp=a76fadaa3919ff339ff3dd87ffe62ef757ad203c;hpb=f385eff0dd0aa61fbf21ae946c424f4a6a26de04;p=ldk-java diff --git a/src/main/java/org/ldk/structs/NodeId.java b/src/main/java/org/ldk/structs/NodeId.java index a76fadaa..830cfdc3 100644 --- a/src/main/java/org/ldk/structs/NodeId.java +++ b/src/main/java/org/ldk/structs/NodeId.java @@ -60,7 +60,27 @@ public class NodeId extends CommonBase { } /** - * Checks if two NodeIds contain equal inner contents. + * Get the public key as an array from this NodeId + */ + public byte[] as_array() { + byte[] ret = bindings.NodeId_as_array(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Get the public key from this NodeId + */ + public Result_PublicKeySecp256k1ErrorZ as_pubkey() { + long ret = bindings.NodeId_as_pubkey(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PublicKeySecp256k1ErrorZ ret_hu_conv = Result_PublicKeySecp256k1ErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the NodeId. */ public long hash() { long ret = bindings.NodeId_hash(this.ptr);