* A human-readable message describing the error
*/
public string get_err() {
- string ret = bindings.LightningError_get_err(this.ptr);
+ long ret = bindings.LightningError_get_err(this.ptr);
GC.KeepAlive(this);
- return ret;
+ if (ret >= 0 && ret <= 4096) { return null; }
+ string ret_conv = InternalUtils.decodeString(ret);
+ return ret_conv;
}
/**
* A human-readable message describing the error
*/
public void set_err(string val) {
- bindings.LightningError_set_err(this.ptr, val);
+ bindings.LightningError_set_err(this.ptr, InternalUtils.encodeString(val));
GC.KeepAlive(this);
GC.KeepAlive(val);
}
bindings.LightningError_set_action(this.ptr, val.ptr);
GC.KeepAlive(this);
GC.KeepAlive(val);
+ if (this != null) { this.ptrs_to.AddLast(val); };
}
/**
* Constructs a new LightningError given each field
*/
public static LightningError of(string err_arg, org.ldk.structs.ErrorAction action_arg) {
- long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
+ long ret = bindings.LightningError_new(InternalUtils.encodeString(err_arg), action_arg.ptr);
GC.KeepAlive(err_arg);
GC.KeepAlive(action_arg);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action_arg); };
return ret_hu_conv;
}