Fix next address
This commit is contained in:
parent
fe8dcd2f94
commit
7e9d47c8e9
2 changed files with 23 additions and 14 deletions
|
|
@ -800,17 +800,20 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
|||
};
|
||||
|
||||
root.getAddress = function(wallet, forceNew, cb) {
|
||||
|
||||
storageService.getLastAddress(wallet.id, function(err, addr) {
|
||||
if (err) return cb(err);
|
||||
|
||||
if (!forceNew && addr) return cb(null, addr);
|
||||
|
||||
createAddress(wallet, function(err, _addr) {
|
||||
if (err) return cb(err, addr);
|
||||
storageService.storeLastAddress(wallet.id, _addr, function() {
|
||||
if (err) return cb(err);
|
||||
return cb(null, _addr);
|
||||
root.isReady(wallet, function(err) {
|
||||
if (err) return cb(err);
|
||||
|
||||
createAddress(wallet, function(err, _addr) {
|
||||
if (err) return cb(err, addr);
|
||||
storageService.storeLastAddress(wallet.id, _addr, function() {
|
||||
if (err) return cb(err);
|
||||
return cb(null, _addr);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue