forked from Qortal/qortal
Default birthday for ARRR moved to "arrrDefaultBirthday" (default 2000000).
This allows users to increase their default birthday if they know that no wallets were created before a certain block, to reduce sync time. It also fixed some failed unit tests that relied on transactions between blocks 1900000 and 2000000.
This commit is contained in:
parent
b46c3cf95f
commit
9debebe03e
@ -26,8 +26,6 @@ public class PirateChain extends Bitcoiny {
|
||||
|
||||
public static final String CURRENCY_CODE = "ARRR";
|
||||
|
||||
public static final int DEFAULT_BIRTHDAY = 2000000;
|
||||
|
||||
private static final Coin DEFAULT_FEE_PER_KB = Coin.valueOf(10000); // 0.0001 ARRR per 1000 bytes
|
||||
|
||||
private static final long MINIMUM_ORDER_AMOUNT = 10000; // 0.0001 ARRR minimum order, to avoid dust errors // TODO: increase this
|
||||
|
@ -14,14 +14,13 @@ import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.qortal.settings.Settings;
|
||||
import org.qortal.transform.TransformationException;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.qortal.crosschain.PirateChain.DEFAULT_BIRTHDAY;
|
||||
|
||||
/** Pirate Chain network support for querying Bitcoiny-related info like block headers, transaction outputs, etc. */
|
||||
public class PirateLightClient extends BitcoinyBlockchainProvider {
|
||||
|
||||
@ -470,8 +469,9 @@ public class PirateLightClient extends BitcoinyBlockchainProvider {
|
||||
public List<BitcoinyTransaction> getAddressBitcoinyTransactions(String address, boolean includeUnconfirmed) throws ForeignBlockchainException {
|
||||
try {
|
||||
// Firstly we need to get the latest block
|
||||
int defaultBirthday = Settings.getInstance().getArrrDefaultBirthday();
|
||||
BlockID endBlock = this.getCompactTxStreamerStub().getLatestBlock(null);
|
||||
BlockID startBlock = BlockID.newBuilder().setHeight(DEFAULT_BIRTHDAY).build();
|
||||
BlockID startBlock = BlockID.newBuilder().setHeight(defaultBirthday).build();
|
||||
BlockRange blockRange = BlockRange.newBuilder().setStart(startBlock).setEnd(endBlock).build();
|
||||
|
||||
TransparentAddressBlockFilter blockFilter = TransparentAddressBlockFilter.newBuilder()
|
||||
|
@ -25,8 +25,6 @@ import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
|
||||
import static org.qortal.crosschain.PirateChain.DEFAULT_BIRTHDAY;
|
||||
|
||||
public class PirateWallet {
|
||||
|
||||
protected static final Logger LOGGER = LogManager.getLogger(PirateWallet.class);
|
||||
@ -87,7 +85,7 @@ public class PirateWallet {
|
||||
if (wallet == null) {
|
||||
// Wallet doesn't exist, so create a new one
|
||||
|
||||
int birthday = DEFAULT_BIRTHDAY;
|
||||
int birthday = Settings.getInstance().getArrrDefaultBirthday();
|
||||
if (this.isNullSeedWallet) {
|
||||
try {
|
||||
// Attempt to set birthday to the current block for null seed wallets
|
||||
|
@ -238,9 +238,11 @@ public class Settings {
|
||||
/** Whether to show SysTray pop-up notifications when trade-bot entries change state */
|
||||
private boolean tradebotSystrayEnabled = false;
|
||||
|
||||
/** Wallets path - used for storing enrppted wallet caches for coins that require them */
|
||||
/** Wallets path - used for storing encrypted wallet caches for coins that require them */
|
||||
private String walletsPath = "wallets";
|
||||
|
||||
private int arrrDefaultBirthday = 2000000;
|
||||
|
||||
// Repository related
|
||||
/** Queries that take longer than this are logged. (milliseconds) */
|
||||
private Long slowQueryThreshold = null;
|
||||
@ -729,6 +731,10 @@ public class Settings {
|
||||
return this.walletsPath;
|
||||
}
|
||||
|
||||
public int getArrrDefaultBirthday() {
|
||||
return this.arrrDefaultBirthday;
|
||||
}
|
||||
|
||||
public boolean isTradebotSystrayEnabled() {
|
||||
return this.tradebotSystrayEnabled;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class PirateChainTests extends Common {
|
||||
|
||||
@Before
|
||||
public void beforeTest() throws DataException {
|
||||
Common.useDefaultSettings(); // TestNet3
|
||||
Common.useDefaultSettings();
|
||||
pirateChain = PirateChain.getInstance();
|
||||
}
|
||||
|
||||
|
@ -15,5 +15,6 @@
|
||||
"tempDataPath": "data-test/_temp",
|
||||
"listsPath": "lists-test",
|
||||
"storagePolicy": "FOLLOWED_OR_VIEWED",
|
||||
"maxStorageCapacity": 104857600
|
||||
"maxStorageCapacity": 104857600,
|
||||
"arrrDefaultBirthday": 1900000
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user