private DisconnectPeer(long ptr, bindings.LDKErrorAction.DisconnectPeer obj) {
super(null, ptr);
long msg = obj.msg;
- ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ErrorMessage(null, msg); }
- msg_hu_conv.ptrs_to.add(this);
+ org.ldk.structs.ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ErrorMessage(null, msg); }
+ if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
this.msg = msg_hu_conv;
}
}
private SendErrorMessage(long ptr, bindings.LDKErrorAction.SendErrorMessage obj) {
super(null, ptr);
long msg = obj.msg;
- ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ErrorMessage(null, msg); }
- msg_hu_conv.ptrs_to.add(this);
+ org.ldk.structs.ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ErrorMessage(null, msg); }
+ if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
this.msg = msg_hu_conv;
}
}
private SendWarningMessage(long ptr, bindings.LDKErrorAction.SendWarningMessage obj) {
super(null, ptr);
long msg = obj.msg;
- WarningMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new WarningMessage(null, msg); }
- msg_hu_conv.ptrs_to.add(this);
+ org.ldk.structs.WarningMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.WarningMessage(null, msg); }
+ if (msg_hu_conv != null) { msg_hu_conv.ptrs_to.add(this); };
this.msg = msg_hu_conv;
this.log_level = obj.log_level;
}
Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(this);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
return ret_hu_conv;
}
* Utility method to constructs a new DisconnectPeer-variant ErrorAction
*/
public static ErrorAction disconnect_peer(ErrorMessage msg) {
- long ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr & ~1);
+ long ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr);
Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
return ret_hu_conv;
}
long ret = bindings.ErrorAction_ignore_error();
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}
Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}
long ret = bindings.ErrorAction_ignore_duplicate_gossip();
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}
* Utility method to constructs a new SendErrorMessage-variant ErrorAction
*/
public static ErrorAction send_error_message(ErrorMessage msg) {
- long ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr & ~1);
+ long ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr);
Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
return ret_hu_conv;
}
* Utility method to constructs a new SendWarningMessage-variant ErrorAction
*/
public static ErrorAction send_warning_message(WarningMessage msg, org.ldk.enums.Level log_level) {
- long ret = bindings.ErrorAction_send_warning_message(msg == null ? 0 : msg.ptr & ~1, log_level);
+ long ret = bindings.ErrorAction_send_warning_message(msg == null ? 0 : msg.ptr, log_level);
Reference.reachabilityFence(msg);
Reference.reachabilityFence(log_level);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(msg); };
return ret_hu_conv;
}