Guest User

Untitled

a guest
Dec 18th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. function unlockAccount(val) {
  2. var accounts = web3.eth.coinbase;
  3. var passphrase = val;
  4. if(passphrase !=null){
  5. web3.personal.unlockAccount(web3.eth.coinbase, passphrase,1000, function (error, result){
  6. if(error){
  7. var str =error.toString();
  8. if(str.includes("could not decrypt")){
  9. bootbox.hideAll();
  10. document.getElementById("loading").style.display = "none";
  11. document.getElementById("successAlert").style.display = "none";
  12. if(document.getElementById("dangerAlert")){
  13. document.getElementById("dangerAlert").style.display = "none";
  14. }
  15. bootbox.alert("Please enter the valid Passphrase.! ");
  16. }
  17. }
  18. });
  19. }
  20. }
  21.  
  22. web3.personal.unlockAccount("0x..", "<pass>");
Add Comment
Please, Sign In to add comment