mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-08-01 12:31:23 +00:00
Inline (fake) constant to only method using it.
Due to cyclic dependencies (NetworkParameters vs. Coin) MAX_SATOSHIS cannot be made a true constant.
This commit is contained in:
@@ -82,10 +82,9 @@ public final class Coin implements Monetary, Comparable<Coin>, Serializable {
|
||||
*/
|
||||
public final long value;
|
||||
|
||||
private final long MAX_SATOSHIS = COIN_VALUE * NetworkParameters.MAX_COINS;
|
||||
|
||||
private Coin(final long satoshis) {
|
||||
checkArgument(-MAX_SATOSHIS <= satoshis && satoshis <= MAX_SATOSHIS,
|
||||
long maxSatoshis = COIN_VALUE * NetworkParameters.MAX_COINS;
|
||||
checkArgument(-maxSatoshis <= satoshis && satoshis <= maxSatoshis,
|
||||
"%s satoshis exceeds maximum possible quantity of Bitcoin.", satoshis);
|
||||
this.value = satoshis;
|
||||
}
|
||||
|
Reference in New Issue
Block a user