impl_holder.held = new KeysInterface(new bindings.LDKKeysInterface() {
@Override public byte[] get_node_secret() {
byte[] ret = arg.get_node_secret();
- return ret;
+ byte[] result = InternalUtils.check_arr_len(ret, 32);
+ return result;
}
@Override public byte[] get_destination_script() {
byte[] ret = arg.get_destination_script();
}
@Override public long get_shutdown_scriptpubkey() {
ShutdownScript ret = arg.get_shutdown_scriptpubkey();
- long result = ret == null ? 0 : ret.ptr & ~1;
+ long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
@Override public long get_channel_signer(boolean inbound, long channel_value_satoshis) {
Sign ret = arg.get_channel_signer(inbound, channel_value_satoshis);
- long result = ret == null ? 0 : ret.ptr;
+ long result = ret == null ? 0 : ret.clone_ptr();
impl_holder.held.ptrs_to.add(ret);
return result;
}
@Override public byte[] get_secure_random_bytes() {
byte[] ret = arg.get_secure_random_bytes();
- return ret;
+ byte[] result = InternalUtils.check_arr_len(ret, 32);
+ return result;
}
@Override public long read_chan_signer(byte[] reader) {
Result_SignDecodeErrorZ ret = arg.read_chan_signer(reader);
- long result = ret != null ? ret.ptr : 0;
+ long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
@Override public long sign_invoice(byte[] invoice_preimage) {
Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(invoice_preimage);
- long result = ret != null ? ret.ptr : 0;
+ long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
});
*/
public ShutdownScript get_shutdown_scriptpubkey() {
long ret = bindings.KeysInterface_get_shutdown_scriptpubkey(this.ptr);
- if (ret < 1024) { return null; }
- ShutdownScript ret_hu_conv = new ShutdownScript(null, ret);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); }
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
*/
public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) {
long ret = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis);
- if (ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Sign ret_hu_conv = new Sign(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) {
long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader);
- if (ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage) {
long ret = bindings.KeysInterface_sign_invoice(this.ptr, invoice_preimage);
- if (ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}