diff --git a/src/main/java/org/qortal/crosschain/PirateChain.java b/src/main/java/org/qortal/crosschain/PirateChain.java index 42da1677..733fd175 100644 --- a/src/main/java/org/qortal/crosschain/PirateChain.java +++ b/src/main/java/org/qortal/crosschain/PirateChain.java @@ -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 diff --git a/src/main/java/org/qortal/crosschain/PirateLightClient.java b/src/main/java/org/qortal/crosschain/PirateLightClient.java index 3b79ceb2..63bcd5fa 100644 --- a/src/main/java/org/qortal/crosschain/PirateLightClient.java +++ b/src/main/java/org/qortal/crosschain/PirateLightClient.java @@ -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 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() diff --git a/src/main/java/org/qortal/crosschain/PirateWallet.java b/src/main/java/org/qortal/crosschain/PirateWallet.java index 0547122f..62926838 100644 --- a/src/main/java/org/qortal/crosschain/PirateWallet.java +++ b/src/main/java/org/qortal/crosschain/PirateWallet.java @@ -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 diff --git a/src/main/java/org/qortal/settings/Settings.java b/src/main/java/org/qortal/settings/Settings.java index 20195050..d21cdba6 100644 --- a/src/main/java/org/qortal/settings/Settings.java +++ b/src/main/java/org/qortal/settings/Settings.java @@ -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; } diff --git a/src/test/java/org/qortal/test/crosschain/PirateChainTests.java b/src/test/java/org/qortal/test/crosschain/PirateChainTests.java index 9b67570c..7e8112d0 100644 --- a/src/test/java/org/qortal/test/crosschain/PirateChainTests.java +++ b/src/test/java/org/qortal/test/crosschain/PirateChainTests.java @@ -28,7 +28,7 @@ public class PirateChainTests extends Common { @Before public void beforeTest() throws DataException { - Common.useDefaultSettings(); // TestNet3 + Common.useDefaultSettings(); pirateChain = PirateChain.getInstance(); } diff --git a/src/test/resources/test-settings-v2.json b/src/test/resources/test-settings-v2.json index b2ad3db8..0a604efa 100644 --- a/src/test/resources/test-settings-v2.json +++ b/src/test/resources/test-settings-v2.json @@ -15,5 +15,6 @@ "tempDataPath": "data-test/_temp", "listsPath": "lists-test", "storagePolicy": "FOLLOWED_OR_VIEWED", - "maxStorageCapacity": 104857600 + "maxStorageCapacity": 104857600, + "arrrDefaultBirthday": 1900000 }