Skip to content

Commit 1ebb669

Browse files
committed
[Wallet][Model] Badly nStakeSplitThreshold set in optionsModel fixed + value moved to constant STAKE_SPLIT_THRESHOLD.
1 parent 9aa97f1 commit 1ebb669

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/qt/optionsmodel.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,10 @@ void OptionsModel::setWalletDefaultOptions(QSettings& settings, bool reset){
136136
addOverriddenOption("-spendzeroconfchange");
137137

138138
if (!settings.contains("nStakeSplitThreshold") || reset)
139-
settings.setValue("nStakeSplitThreshold", 1);
140-
if (reset){
141-
setStakeSplitThreshold(1);
142-
}
139+
settings.setValue("nStakeSplitThreshold", CWallet::STAKE_SPLIT_THRESHOLD);
143140

144-
if(reset){
141+
if (reset){
142+
setStakeSplitThreshold(CWallet::STAKE_SPLIT_THRESHOLD);
145143
refreshDataView();
146144
}
147145
}
@@ -217,7 +215,7 @@ void OptionsModel::setDisplayDefaultOptions(QSettings& settings, bool reset){
217215
strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "").toString();
218216

219217
if(reset){
220-
emit dataChanged(index(0), index(rowCount(QModelIndex()) - 1));
218+
refreshDataView();
221219
}
222220
}
223221

src/wallet/wallet.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
196196
void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>);
197197

198198
public:
199+
200+
static const int STAKE_SPLIT_THRESHOLD = 2000;
201+
199202
bool MintableCoins();
200203
bool SelectStakeCoins(std::list<std::unique_ptr<CStakeInput> >& listInputs, CAmount nTargetAmount, int blockHeight, bool fPrecompute = false);
201204
bool IsCollateralAmount(CAmount nInputAmount) const;
@@ -337,7 +340,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
337340

338341
// Stake Settings
339342
nHashDrift = 45;
340-
nStakeSplitThreshold = 2000;
343+
nStakeSplitThreshold = STAKE_SPLIT_THRESHOLD;
341344
nHashInterval = 22;
342345
nStakeSetUpdateTime = 300; // 5 minutes
343346

0 commit comments

Comments
 (0)