@@ -75,6 +75,8 @@ var App = (function(App, undefined) {
75
75
App . uiIsInitialized = false ;
76
76
App . doNodeStarted = false ;
77
77
78
+ var minWeightMagnitudeMinimum = ( isTestNet ? 9 : 15 ) ;
79
+
78
80
App . initialize = function ( ) {
79
81
appDirectory = path . dirname ( __dirname ) ;
80
82
resourcesDirectory = path . dirname ( appDirectory ) ;
@@ -174,20 +176,10 @@ var App = (function(App, undefined) {
174
176
if ( ! settings . hasOwnProperty ( "depth" ) ) {
175
177
settings . depth = 3 ;
176
178
}
177
- if ( ! settings . hasOwnProperty ( "lastOverride" ) ) {
178
- settings . lastOverride = null ;
179
- }
180
- if ( settings . lastOverride != 1 ) {
181
- settings . minWeightMagnitude = ( isTestNet ? 9 : 13 ) ;
182
- settings . lastOverride = 1 ;
183
- }
184
179
if ( ! settings . hasOwnProperty ( "minWeightMagnitude" ) ) {
185
- settings . minWeightMagnitude = 13 ;
186
- }
187
- if ( ! isTestNet && settings . minWeightMagnitude < 13 ) {
188
- settings . minWeightMagnitude = 13 ;
189
- } else if ( isTestNet && settings . minWeightMagnitude < 9 ) {
190
- settings . minWeightMagnitude = 9 ;
180
+ settings . minWeightMagnitude = minWeightMagnitudeMinimum ;
181
+ } else if ( settings . minWeightMagnitude < minWeightMagnitudeMinimum ) {
182
+ settings . minWeightMagnitude = minWeightMagnitudeMinimum ;
191
183
}
192
184
if ( ! settings . hasOwnProperty ( "nodes" ) || typeof settings . nodes != "object" ) {
193
185
settings . nodes = [ ] ;
@@ -850,6 +842,12 @@ var App = (function(App, undefined) {
850
842
851
843
App . findDirectories = function ( ) {
852
844
try {
845
+ /*
846
+ if (process.platform == "win32" && process.env.LOCALAPPDATA) {
847
+ electron.app.setPath("appData", process.env.LOCALAPPDATA);
848
+ //electron.app.setPath("userData", path.join(process.env.LOCALAPPDATA, electron.app.getName()));
849
+ }*/
850
+
853
851
appDataDirectory = path . join ( electron . app . getPath ( "appData" ) , "IOTA Wallet" + ( isTestNet ? " Testnet" : "" ) ) ;
854
852
855
853
databaseDirectory = ( settings . dbLocation ? settings . dbLocation : path . join ( appDataDirectory , "iri" ) ) ;
@@ -1939,9 +1937,9 @@ var App = (function(App, undefined) {
1939
1937
walletType = settings . lightWallet ;
1940
1938
}
1941
1939
if ( walletType == 1 ) {
1942
- var config = { "lightWallet" : 1 , "lightWalletHost" : settings . lightWalletHost , "lightWalletPort" : settings . lightWalletPort , "minWeightMagnitude" : settings . minWeightMagnitude , "testNet" : isTestNet } ;
1940
+ var config = { "lightWallet" : 1 , "lightWalletHost" : settings . lightWalletHost , "lightWalletPort" : settings . lightWalletPort , "minWeightMagnitude" : settings . minWeightMagnitude , "testNet" : isTestNet , "minWeightMagnitudeMinimum" : minWeightMagnitudeMinimum } ;
1943
1941
} else {
1944
- var config = { "lightWallet" : 0 , "port" : settings . port , "udpReceiverPort" : settings . udpReceiverPort , "tcpReceiverPort" : settings . tcpReceiverPort , "sendLimit" : settings . sendLimit , "depth" : settings . depth , "minWeightMagnitude" : settings . minWeightMagnitude , "testNet" : isTestNet , "dbLocation" : databaseDirectory } ;
1942
+ var config = { "lightWallet" : 0 , "port" : settings . port , "udpReceiverPort" : settings . udpReceiverPort , "tcpReceiverPort" : settings . tcpReceiverPort , "sendLimit" : settings . sendLimit , "depth" : settings . depth , "minWeightMagnitude" : settings . minWeightMagnitude , "testNet" : isTestNet , "dbLocation" : databaseDirectory , "minWeightMagnitudeMinimum" : minWeightMagnitudeMinimum } ;
1945
1943
}
1946
1944
win . webContents . send ( "editNodeConfiguration" , config ) ;
1947
1945
}
@@ -2081,11 +2079,8 @@ var App = (function(App, undefined) {
2081
2079
2082
2080
if ( configuration . hasOwnProperty ( "minWeightMagnitude" ) ) {
2083
2081
settings . minWeightMagnitude = parseInt ( configuration . minWeightMagnitude , 10 ) ;
2084
-
2085
- if ( ! isTestNet && settings . minWeightMagnitude < 13 ) {
2086
- settings . minWeightMagnitude = 13 ;
2087
- } else if ( isTestNet && settings . minWeightMagnitude < 9 ) {
2088
- settings . minWeightMagnitude = 9 ;
2082
+ if ( settings . minWeightMagnitude < minWeightMagnitudeMinimum ) {
2083
+ settings . minWeightMagnitude = minWeightMagnitudeMinimum ;
2089
2084
}
2090
2085
}
2091
2086
0 commit comments