mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-03 05:57:21 +00:00
Move ECKey.toAddress() to Address.fromKey().
This is a preparation for supporting native segwit addresses. Keys can't know what type of address is wanted. In future, there will also be a SegwitAddress.fromKey().
This commit is contained in:
@@ -1355,7 +1355,7 @@ public class WalletTool {
|
||||
}
|
||||
key = wallet.freshReceiveKey();
|
||||
}
|
||||
System.out.println(key.toAddress(params) + " " + key);
|
||||
System.out.println(Address.fromKey(params, key) + " " + key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1420,7 +1420,7 @@ public class WalletTool {
|
||||
key = key.encrypt(checkNotNull(wallet.getKeyCrypter()), aesKey);
|
||||
}
|
||||
wallet.importKey(key);
|
||||
System.out.println(key.toAddress(params) + " " + key);
|
||||
System.out.println(Address.fromKey(params, key) + " " + key);
|
||||
} catch (KeyCrypterException kce) {
|
||||
System.err.println("There was an encryption related error when adding the key. The error was '" + kce.getMessage() + "'.");
|
||||
}
|
||||
@@ -1480,7 +1480,7 @@ public class WalletTool {
|
||||
|
||||
private static void currentReceiveAddr() {
|
||||
ECKey key = wallet.currentReceiveKey();
|
||||
System.out.println(key.toAddress(params) + " " + key);
|
||||
System.out.println(Address.fromKey(params, key) + " " + key);
|
||||
}
|
||||
|
||||
private static void dumpWallet() throws BlockStoreException {
|
||||
|
||||
Reference in New Issue
Block a user