Merge pull request #1229 from chaotixkilla/fix-remove-xmr-wallet-password
Allow for password-unprotected XMR wallets
This commit is contained in:
commit
d5ddf5f74f
1 changed files with 12 additions and 1 deletions
|
|
@ -63,6 +63,12 @@ function handleError (error, method) {
|
|||
}
|
||||
case -21:
|
||||
throw new Error('Wallet already exists!')
|
||||
case -22:
|
||||
try {
|
||||
return openWalletWithPassword()
|
||||
} catch {
|
||||
throw new Error('Invalid wallet password!')
|
||||
}
|
||||
case -17:
|
||||
throw new E.InsufficientFundsError()
|
||||
case -37:
|
||||
|
|
@ -79,11 +85,16 @@ function handleError (error, method) {
|
|||
}
|
||||
|
||||
function openWallet () {
|
||||
return fetch('open_wallet', { filename: 'Wallet' })
|
||||
.catch(err => handleError(err, 'openWallet'))
|
||||
}
|
||||
|
||||
function openWalletWithPassword () {
|
||||
return fetch('open_wallet', { filename: 'Wallet', password: rpcConfig().password })
|
||||
}
|
||||
|
||||
function createWallet () {
|
||||
return fetch('create_wallet', { filename: 'Wallet', password: rpcConfig().password, language: 'English' })
|
||||
return fetch('create_wallet', { filename: 'Wallet', language: 'English' })
|
||||
.then(() => new Promise(() => setTimeout(() => openWallet(), 3000)))
|
||||
.then(() => fetch('auto_refresh'))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue