clean up address scan config
This commit is contained in:
parent
eb006c3db3
commit
d451fff6fc
|
@ -35,10 +35,8 @@ Constants.BACKOFF_TIME = 2;
|
||||||
|
|
||||||
Constants.MAX_MAIN_ADDRESS_GAP = 20;
|
Constants.MAX_MAIN_ADDRESS_GAP = 20;
|
||||||
|
|
||||||
// Fund scanning parameters
|
// TODO: should allow different gap sizes for external/internal chains
|
||||||
Constants.SCAN_CONFIG = {
|
Constants.SCAN_ADDRESS_GAP = Constants.MAX_MAIN_ADDRESS_GAP;
|
||||||
maxGap: Constants.MAX_MAIN_ADDRESS_GAP,
|
|
||||||
};
|
|
||||||
|
|
||||||
Constants.FEE_LEVELS = [{
|
Constants.FEE_LEVELS = [{
|
||||||
name: 'priority',
|
name: 'priority',
|
||||||
|
|
|
@ -1937,7 +1937,7 @@ WalletService.prototype.scan = function(opts, cb) {
|
||||||
function scanBranch(derivator, cb) {
|
function scanBranch(derivator, cb) {
|
||||||
var inactiveCounter = 0;
|
var inactiveCounter = 0;
|
||||||
var allAddresses = [];
|
var allAddresses = [];
|
||||||
var gap = Constants.SCAN_CONFIG.maxGap;
|
var gap = Constants.SCAN_ADDRESS_GAP;
|
||||||
|
|
||||||
async.whilst(function() {
|
async.whilst(function() {
|
||||||
return inactiveCounter < gap;
|
return inactiveCounter < gap;
|
||||||
|
|
|
@ -4953,7 +4953,7 @@ describe('Wallet service', function() {
|
||||||
describe('1-of-1 wallet (BIP44 & P2PKH)', function() {
|
describe('1-of-1 wallet (BIP44 & P2PKH)', function() {
|
||||||
beforeEach(function(done) {
|
beforeEach(function(done) {
|
||||||
this.timeout(5000);
|
this.timeout(5000);
|
||||||
Constants.SCAN_CONFIG.maxGap = 2;
|
Constants.SCAN_ADDRESS_GAP = 2;
|
||||||
|
|
||||||
helpers.createAndJoinWallet(1, 1, function(s, w) {
|
helpers.createAndJoinWallet(1, 1, function(s, w) {
|
||||||
server = s;
|
server = s;
|
||||||
|
@ -5145,7 +5145,7 @@ describe('Wallet service', function() {
|
||||||
|
|
||||||
beforeEach(function(done) {
|
beforeEach(function(done) {
|
||||||
this.timeout(5000);
|
this.timeout(5000);
|
||||||
Constants.SCAN_CONFIG.maxGap = 2;
|
Constants.SCAN_ADDRESS_GAP = 2;
|
||||||
|
|
||||||
helpers.createAndJoinWallet(1, 2, {
|
helpers.createAndJoinWallet(1, 2, {
|
||||||
supportBIP44AndP2PKH: false
|
supportBIP44AndP2PKH: false
|
||||||
|
@ -5227,7 +5227,7 @@ describe('Wallet service', function() {
|
||||||
var scanConfigOld = Constants.SCAN_CONFIG;
|
var scanConfigOld = Constants.SCAN_CONFIG;
|
||||||
beforeEach(function(done) {
|
beforeEach(function(done) {
|
||||||
this.timeout(5000);
|
this.timeout(5000);
|
||||||
Constants.SCAN_CONFIG.maxGap = 2;
|
Constants.SCAN_ADDRESS_GAP = 2;
|
||||||
|
|
||||||
helpers.createAndJoinWallet(1, 1, {
|
helpers.createAndJoinWallet(1, 1, {
|
||||||
supportBIP44AndP2PKH: false
|
supportBIP44AndP2PKH: false
|
||||||
|
@ -5296,7 +5296,7 @@ describe('Wallet service', function() {
|
||||||
});
|
});
|
||||||
it('should start multiple asynchronous scans for different wallets', function(done) {
|
it('should start multiple asynchronous scans for different wallets', function(done) {
|
||||||
helpers.stubAddressActivity(['3K2VWMXheGZ4qG35DyGjA2dLeKfaSr534A']);
|
helpers.stubAddressActivity(['3K2VWMXheGZ4qG35DyGjA2dLeKfaSr534A']);
|
||||||
Constants.SCAN_CONFIG.scanWindow = 1;
|
Constants.SCAN_ADDRESS_GAP = 1;
|
||||||
|
|
||||||
var scans = 0;
|
var scans = 0;
|
||||||
server.messageBroker.onMessage(function(n) {
|
server.messageBroker.onMessage(function(n) {
|
||||||
|
|
Loading…
Reference in New Issue