Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/qt/bitcoinamountfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ class AmountSpinBox: public QAbstractSpinBox
val.second = val.second + steps * currentSingleStep;
val.second = qMax(val.second, CAmount(0));
val.second = qBound(m_min_amount, val.second, m_max_amount);
// 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());
}
// ELEMENTS: issued assets can have values > MAX_MONEY
if (val.first == Params().GetConsensus().pegged_asset)
{
val.second = qMin(val.second, BitcoinUnits::maxMoney());
}
Comment on lines +128 to +131
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think your editor added some tabs here, not a blocking issue though

Suggested change
if (val.first == Params().GetConsensus().pegged_asset)
{
val.second = qMin(val.second, BitcoinUnits::maxMoney());
}
if (val.first == Params().GetConsensus().pegged_asset) {
val.second = qMin(val.second, BitcoinUnits::maxMoney());
}

setValue(val);
}

Expand Down Expand Up @@ -228,8 +228,8 @@ class AmountSpinBox: public QAbstractSpinBox
bool valid = GUIUtil::parseAssetAmount(current_asset, text, currentUnit, &val);
if(valid)
{
// FIXME: Add this back in when assets can have > MAX_MONEY
if (val < 0 || (val > BitcoinUnits::maxMoney() /*&& current_asset == Params().GetConsensus().pegged_asset*/)) {
// ELEMENTS: issued assets can have values > MAX_MONEY
if (val < 0 || (val > BitcoinUnits::maxMoney() && current_asset == Params().GetConsensus().pegged_asset)) {
valid = false;
}
}
Expand Down