if (raw_val.getClass() == bindings.LDKSendError.InvalidFirstHop.class) {
return new InvalidFirstHop(ptr, (bindings.LDKSendError.InvalidFirstHop)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKSendError.PathNotFound.class) {
+ return new PathNotFound(ptr, (bindings.LDKSendError.PathNotFound)raw_val);
+ }
if (raw_val.getClass() == bindings.LDKSendError.InvalidMessage.class) {
return new InvalidMessage(ptr, (bindings.LDKSendError.InvalidMessage)raw_val);
}
if (raw_val.getClass() == bindings.LDKSendError.GetNodeIdFailed.class) {
return new GetNodeIdFailed(ptr, (bindings.LDKSendError.GetNodeIdFailed)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKSendError.UnresolvedIntroductionNode.class) {
+ return new UnresolvedIntroductionNode(ptr, (bindings.LDKSendError.UnresolvedIntroductionNode)raw_val);
+ }
if (raw_val.getClass() == bindings.LDKSendError.BlindedPathAdvanceFailed.class) {
return new BlindedPathAdvanceFailed(ptr, (bindings.LDKSendError.BlindedPathAdvanceFailed)raw_val);
}
}
}
/**
- * The provided [`Destination`] was an invalid [`BlindedPath`], due to having fewer than two
- * blinded hops.
+ * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
+ * hops.
*/
public final static class TooFewBlindedHops extends SendError {
private TooFewBlindedHops(long ptr, bindings.LDKSendError.TooFewBlindedHops obj) {
}
}
/**
- * Our next-hop peer was offline or does not support onion message forwarding.
+ * The first hop is not a peer and doesn't have a known [`SocketAddress`].
*/
public final static class InvalidFirstHop extends SendError {
+ public final byte[] invalid_first_hop;
private InvalidFirstHop(long ptr, bindings.LDKSendError.InvalidFirstHop obj) {
super(null, ptr);
+ this.invalid_first_hop = obj.invalid_first_hop;
+ }
+ }
+ /**
+ * A path from the sender to the destination could not be found by the [`MessageRouter`].
+ */
+ public final static class PathNotFound extends SendError {
+ private PathNotFound(long ptr, bindings.LDKSendError.PathNotFound obj) {
+ super(null, ptr);
}
}
/**
/**
* Failed to retrieve our node id from the provided [`NodeSigner`].
*
- * [`NodeSigner`]: crate::chain::keysinterface::NodeSigner
+ * [`NodeSigner`]: crate::sign::NodeSigner
*/
public final static class GetNodeIdFailed extends SendError {
private GetNodeIdFailed(long ptr, bindings.LDKSendError.GetNodeIdFailed obj) {
super(null, ptr);
}
}
+ /**
+ * The provided [`Destination`] has a blinded path with an unresolved introduction node. An
+ * attempt to resolve it in the [`MessageRouter`] when finding an [`OnionMessagePath`] likely
+ * failed.
+ */
+ public final static class UnresolvedIntroductionNode extends SendError {
+ private UnresolvedIntroductionNode(long ptr, bindings.LDKSendError.UnresolvedIntroductionNode obj) {
+ super(null, ptr);
+ }
+ }
/**
* We attempted to send to a blinded path where we are the introduction node, and failed to
* advance the blinded path to make the second hop the new introduction node. Either
/**
* Utility method to constructs a new InvalidFirstHop-variant SendError
*/
- public static SendError invalid_first_hop() {
- long ret = bindings.SendError_invalid_first_hop();
+ public static SendError invalid_first_hop(byte[] a) {
+ long ret = bindings.SendError_invalid_first_hop(InternalUtils.check_arr_len(a, 33));
+ Reference.reachabilityFence(a);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.SendError ret_hu_conv = org.ldk.structs.SendError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PathNotFound-variant SendError
+ */
+ public static SendError path_not_found() {
+ long ret = bindings.SendError_path_not_found();
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.SendError ret_hu_conv = org.ldk.structs.SendError.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}
+ /**
+ * Utility method to constructs a new UnresolvedIntroductionNode-variant SendError
+ */
+ public static SendError unresolved_introduction_node() {
+ long ret = bindings.SendError_unresolved_introduction_node();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.SendError ret_hu_conv = org.ldk.structs.SendError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
/**
* Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
*/
return ret_hu_conv;
}
+ /**
+ * Generates a non-cryptographic 64-bit hash of the SendError.
+ */
+ public long hash() {
+ long ret = bindings.SendError_hash(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two SendErrors contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(org.ldk.structs.SendError b) {
- boolean ret = bindings.SendError_eq(this.ptr, b == null ? 0 : b.ptr);
+ boolean ret = bindings.SendError_eq(this.ptr, b.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(b);
return ret;