mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
GUI: BitcoinAmountField: Limit issued assets to 21M
MoneyRange at least seems to enforce 21M on assets, so do it here too
This commit is contained in:
parent
2ebae1ab89
commit
af726c7c36
1 changed files with 5 additions and 2 deletions
|
|
@ -99,7 +99,9 @@ public:
|
|||
}
|
||||
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 @@ private:
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue