From af726c7c36325ee469d388f9eb11a654bced4a59 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 7 Jan 2019 14:49:00 +0000 Subject: [PATCH] GUI: BitcoinAmountField: Limit issued assets to 21M MoneyRange at least seems to enforce 21M on assets, so do it here too --- src/qt/bitcoinamountfield.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index c389d0bd71..83ecb44002 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -99,7 +99,9 @@ class AmountSpinBox: public QAbstractSpinBox } val.second = val.second + steps * singleStep; val.second = qMax(val.second, CAmount(0)); - if (val.first == Params().GetConsensus().pegged_asset) { + // FIXME: Add this back in when assets can have > MAX_MONEY + // if (val.first == Params().GetConsensus().pegged_asset) + { val.second = qMin(val.second, BitcoinUnits::maxMoney()); } setValue(val); @@ -198,7 +200,8 @@ class AmountSpinBox: public QAbstractSpinBox bool valid = GUIUtil::parseAssetAmount(current_asset, text, currentUnit, &val); if(valid) { - if (val < 0 || (val > BitcoinUnits::maxMoney() && current_asset == Params().GetConsensus().pegged_asset)) { + // FIXME: Add this back in when assets can have > MAX_MONEY + if (val < 0 || (val > BitcoinUnits::maxMoney() /*&& current_asset == Params().GetConsensus().pegged_asset*/)) { valid = false; } }