Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/main/c/nativewrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,20 +1120,18 @@ JNIEXPORT jobject JNICALL Java_source_defra_DefraNode_RefreshViewNative(
//=============================================================================

// Bound under DefraNode (not DefraTransaction, despite the C symbol name
// below being left as-is for now) with the 3-arg signature DefraNode.java
// actually declares (TransactionCreateNative(long, boolean isConcurrent,
// boolean isReadOnly)) - the previous 2-arg version here didn't match that
// declaration's arity, and was registered under the wrong class name.
// isConcurrent has no corresponding parameter in the C API and is accepted
// but ignored.
// below being left as-is for now) with the 2-arg signature DefraNode.java
// actually declares (TransactionCreateNative(long, boolean isReadOnly)) - the
// previous version here didn't match that declaration's arity, and was
// registered under the wrong class name. isConcurrent was removed from both
// this native method and the cbindings CreateTransaction API it wraps, which
// never had a corresponding parameter for it.
JNIEXPORT jobject JNICALL Java_source_defra_DefraNode_TransactionCreateNative(
JNIEnv* env,
jobject thiz,
jlong nodePtr,
jboolean isConcurrent,
jboolean isReadOnly
) {
(void)isConcurrent;
int isReadOnlyC = (isReadOnly == JNI_TRUE) ? 1 : 0;
NewTxnResult res = CreateTransaction((uintptr_t)nodePtr, isReadOnlyC);
return returnDefraTransactionResult(env, res);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/source/defra/DefraNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class DefraNode {
private native DefraResult VerifyBlockSignatureNative(long nodePtr, String keyType, String publicKey, String cid, long identityPtr);

// Transaction Methods
private native DefraTransactionResult TransactionCreateNative(long nodePtr, boolean isConcurrent, boolean isReadOnly);
private native DefraTransactionResult TransactionCreateNative(long nodePtr, boolean isReadOnly);

// Private members
private long nodePtr;
Expand Down Expand Up @@ -1051,8 +1051,8 @@ public String verifyBlockSignature(String keyType, String publicKey, String cid,
}

// Function creates a new transaction
public DefraTransaction transactionCreate(boolean isConcurrent, boolean isReadOnly) throws DefraException {
DefraTransactionResult txnResult = TransactionCreateNative(this.nodePtr, isConcurrent, isReadOnly);
public DefraTransaction transactionCreate(boolean isReadOnly) throws DefraException {
DefraTransactionResult txnResult = TransactionCreateNative(this.nodePtr, isReadOnly);
if (txnResult.status != 0) {
throw new DefraException(txnResult.error);
}
Expand Down
Loading