mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Too many bitcoins allowed in amount. (#2401)
Using magic number doesn't seem right. Could we factor this out, together with https://github.com/bitcoin/bitcoin/blob/master/src/bitcoinrpc.cpp#L96 ? And what about BitcoinUnits::parse() as well ?
This commit is contained in:
committed by
Victor Felder
parent
3702f127fd
commit
a35e268da4
@@ -63,6 +63,17 @@ qint64 BitcoinUnits::factor(int unit)
|
||||
}
|
||||
}
|
||||
|
||||
qint64 BitcoinUnits::maxAmount(int unit)
|
||||
{
|
||||
switch(unit)
|
||||
{
|
||||
case BTC: return Q_INT64_C(21000000);
|
||||
case mBTC: return Q_INT64_C(21000000000);
|
||||
case uBTC: return Q_INT64_C(21000000000000);
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int BitcoinUnits::amountDigits(int unit)
|
||||
{
|
||||
switch(unit)
|
||||
|
||||
Reference in New Issue
Block a user