web3.js解锁账户时,一直提示 cannot find key with given address

web3.js解锁账户的代码

web3.eth.personal.unlockAccount(account.address,account.privateKey,6000,(error,res) => {
    console.log(error)
    console.log(res)
})

第一个参数是账号地址,
第二个参数是私钥,
第三个参数是账户解锁有效时间。

运行结果提示:

Error: Returned error: cannot find key with given address 0x776Bd8F12D6C761f2bA147B4c5d0f217078DD4DE
    at Object.ErrorResponse (E:\web\okchain\node_modules\web3-core-helpers\lib\errors.js:28:19)
    at E:\web\okchain\node_modules\web3-core-requestmanager\lib\index.js:302:36
    at XMLHttpRequest.request.onreadystatechange (E:\web\okchain\node_modules\web3-providers-http\lib\index.js:98:13)
    at XMLHttpRequestEventTarget.dispatchEvent (E:\web\okchain\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:34:22)
    at XMLHttpRequest._setReadyState (E:\web\okchain\node_modules\xhr2-cookies\dist\xml-http-request.js:208:14)
    at XMLHttpRequest._onHttpResponseEnd (E:\web\okchain\node_modules\xhr2-cookies\dist\xml-http-request.js:318:14)
    at IncomingMessage.<anonymous> (E:\web\okchain\node_modules\xhr2-cookies\dist\xml-http-request.js:289:61)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  data: null
}

账号是对的 ,私钥也是对的,但提示错误是找不到对应的私钥

求大佬解答呀

阅读 1.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题