Migration to Java 11

Updated pom.xml.
Updated dependencies, including various minor code mods, esp. bitcoin-related.

Starts up and talks to Java 8 nodes!

Dev environment should be at least Eclipse 4.11 with m2e 1.9.1+
This commit is contained in:
catbref
2019-09-30 18:01:23 +01:00
parent b95eea6763
commit 568a1f8a30
7 changed files with 57 additions and 43 deletions

View File

@@ -226,7 +226,7 @@ public class BTC {
protected Wallet createEmptyWallet() {
ECKey dummyKey = new ECKey();
KeyChainGroup keyChainGroup = new KeyChainGroup(params);
KeyChainGroup keyChainGroup = KeyChainGroup.createBasic(params);
keyChainGroup.importKeys(dummyKey);
Wallet wallet = new Wallet(params, keyChainGroup);
@@ -242,12 +242,12 @@ public class BTC {
WalletCoinsReceivedEventListener coinsReceivedListener = new WalletCoinsReceivedEventListener() {
@Override
public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) {
System.out.println("Coins received via transaction " + tx.getHashAsString());
System.out.println("Coins received via transaction " + tx.getTxId().toString());
}
};
wallet.addCoinsReceivedEventListener(coinsReceivedListener);
Address address = Address.fromBase58(params, base58Address);
Address address = Address.fromString(params, base58Address);
wallet.addWatchedAddress(address, startTime);
StoredBlock checkpoint = manager.getCheckpointBefore(startTime);

View File

@@ -385,7 +385,6 @@ public class HSQLDBRepository implements Repository {
* @return ResultSet, or null if there are no found rows
* @throws SQLException
*/
@SuppressWarnings("resource")
public ResultSet checkedExecute(String sql, Object... objects) throws SQLException {
PreparedStatement preparedStatement = this.prepareStatement(sql);

View File

@@ -3,6 +3,7 @@ package org.qora.transaction;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
@@ -347,7 +348,7 @@ public abstract class Transaction {
if (recommendedFee.compareTo(BlockChain.getInstance().getUnitFee()) <= 0) {
recommendedFee = BlockChain.getInstance().getUnitFee();
} else {
recommendedFee = recommendedFee.setScale(0, BigDecimal.ROUND_UP);
recommendedFee = recommendedFee.setScale(0, RoundingMode.CEILING);
}
return recommendedFee.setScale(8);