Minor fix-up to allow go-live:

Re-add (for now) Ed25519 HSQLDB conversion.
Catch DataException in BlockChain.isGenesisBlockValid and return false.
Remove duplicate bug-fix for LeaveGroupTransactions DB table.

Interim, near-final blockchain.json
This commit is contained in:
catbref
2020-06-26 15:06:04 +01:00
parent 2c14a12464
commit 3c139f3e53
4 changed files with 463 additions and 303 deletions

View File

@@ -510,7 +510,7 @@ public class BlockChain {
}
}
private static boolean isGenesisBlockValid() throws DataException {
private static boolean isGenesisBlockValid() {
try (final Repository repository = RepositoryManager.getRepository()) {
BlockRepository blockRepository = repository.getBlockRepository();
@@ -523,6 +523,8 @@ public class BlockChain {
return false;
return GenesisBlock.isGenesisBlock(blockData);
} catch (DataException e) {
return false;
}
}

View File

@@ -618,11 +618,6 @@ public class HSQLDBDatabaseUpdates {
stmt.execute("CREATE TABLE PublicizeTransactions (signature Signature, nonce INT NOT NULL, " + TRANSACTION_KEYS + ")");
break;
case 20:
// XXX Bug-fix, but remove when we build new genesis
stmt.execute("ALTER TABLE LeaveGroupTransactions ADD COLUMN IF NOT EXISTS previous_group_id GroupID");
break;
default:
// nothing to do
return false;

View File

@@ -24,6 +24,8 @@ import java.util.regex.Pattern;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.qortal.account.PrivateKeyAccount;
import org.qortal.crypto.Crypto;
import org.qortal.repository.ATRepository;
import org.qortal.repository.AccountRepository;
import org.qortal.repository.ArbitraryRepository;
@@ -744,4 +746,18 @@ public class HSQLDBRepository implements Repository {
}
}
public static byte[] ed25519PrivateToPublicKey(byte[] privateKey) {
if (privateKey == null)
return null;
return PrivateKeyAccount.toPublicKey(privateKey);
}
public static String ed25519PublicKeyToAddress(byte[] publicKey) {
if (publicKey == null)
return null;
return Crypto.toAddress(publicKey);
}
}