ontology-java-sdk icon indicating copy to clipboard operation
ontology-java-sdk copied to clipboard

Account Error,encryptedPriKey address password not match

Open lishuo5263 opened this issue 6 years ago • 1 comments

when I use ontio java sdk I want transfer ont to another account,I fllow document ,here is my code:

try { Transaction tx = ontSdkClient.nativevm().ont() .makeTransfer(from, to, amount.longValue(), from, 20000, 500); com.github.ontio.account.Account acct = ontSdkClient.getWalletMgr() .getAccount(from, walletPwd); ontSdkClient.signTx(tx, new com.github.ontio.account.Account[][]{{acct}}); ontSdkClient.getConnect().sendRawTransaction(tx.toHexString()); txId = tx.hash().toHexString(); } catch (Exception e) { e.printStackTrace(); }

But when code executed .getAccount(from, walletPwd); I has something wrong, here is my log:

com.github.ontio.sdk.exception.SDKException: {"Desc":"Other Error,{"Desc":"Account Error,encryptedPriKey address password not match.","Error":51015}","Error":59000}

And I change the pom jar version ,whatever jar version I has same error,please help!!!

lishuo5263 avatar Feb 14 '19 07:02 lishuo5263

@lishuo5263 Hi, Maybe you need to open your local wallet file firstly. Something like this:

OntSdk wm = OntSdk.getInstance();
wm.openWalletFile("walletfile.json");

NashMiao avatar Jun 25 '19 03:06 NashMiao