mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-22 20:26:50 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user