Code Duplication    Length = 16-19 lines in 2 locations

lib/wallet.js 2 locations

@@ 789-807 (lines=19) @@
786
        cb = gap;
787
        gap = null;
788
    }
789
790
    var deferred = q.defer();
791
    deferred.promise.spreadNodeify(cb);
792
793
    deferred.resolve(
794
        self.sdk.doWalletDiscovery(self.identifier, gap)
795
            .then(function(result) {
796
                return [result.confirmed, result.unconfirmed];
797
            })
798
    );
799
800
    return deferred.promise;
801
};
802
803
/**
804
 *
805
 * @param [force]   bool            ignore warnings (such as non-zero balance)
806
 * @param [cb]      function        callback(err, success)
807
 * @returns {q.Promise}
808
 */
809
Wallet.prototype.deleteWallet = function(force, cb) {
810
    var self = this;
@@ 867-882 (lines=16) @@
864
        cb = randomizeChangeIdx;
865
        randomizeChangeIdx = true;
866
    } else if (typeof feeStrategy === "function") {
867
        cb = feeStrategy;
868
        feeStrategy = null;
869
    } else if (typeof twoFactorToken === "function") {
870
        cb = twoFactorToken;
871
        twoFactorToken = null;
872
    } else if (typeof options === "function") {
873
        cb = options;
874
        options = {};
875
    }
876
877
    randomizeChangeIdx = typeof randomizeChangeIdx !== "undefined" ? randomizeChangeIdx : true;
878
    feeStrategy = feeStrategy || Wallet.FEE_STRATEGY_OPTIMAL;
879
    options = options || {};
880
    var checkFee = typeof options.checkFee !== "undefined" ? options.checkFee : true;
881
882
    var deferred = q.defer();
883
    deferred.promise.nodeify(cb);
884
885
    if (self.locked) {