mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-02 13:37:24 +00:00
Provide a consistent fromBase58/toBase58 API for the VersionChecksummedBytes hierarchy.
Deprecates the old constructors and migrates bitcoinj itself to use the new API. Also makes DumpedPrivateKey use WrongNetworkException when appropriate. Adds missing testcases and corrects/adds a bit of JavaDoc.
This commit is contained in:
@@ -47,7 +47,7 @@ public class SendMoneyController {
|
||||
// Address exception cannot happen as we validated it beforehand.
|
||||
try {
|
||||
Coin amount = Coin.parseCoin(amountEdit.getText());
|
||||
Address destination = new Address(Main.params, address.getText());
|
||||
Address destination = Address.fromBase58(Main.params, address.getText());
|
||||
Wallet.SendRequest req;
|
||||
if (amount.equals(Main.bitcoin.wallet().getBalance()))
|
||||
req = Wallet.SendRequest.emptyWallet(destination);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BitcoinAddressValidator {
|
||||
|
||||
private boolean testAddr(String text) {
|
||||
try {
|
||||
new Address(params, text);
|
||||
Address.fromBase58(params, text);
|
||||
return true;
|
||||
} catch (AddressFormatException e) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user