Added PirateChain.isValidWalletKey()

This commit is contained in:
CalDescent 2022-05-23 22:11:23 +01:00
parent f7e6d1e5c8
commit 767ef62b64

View File

@ -236,6 +236,13 @@ public class PirateChain extends Bitcoiny {
} }
} }
@Override
public boolean isValidWalletKey(String walletKey) {
// For Pirate Chain, we only care that the key is a random string
// 32 characters in length, as it is used as entropy for the seed.
return walletKey != null && Base58.decode(walletKey).length == 32;
}
/** Returns P2SH address using passed redeem script. */ /** Returns P2SH address using passed redeem script. */
public String deriveP2shAddress(byte[] redeemScriptBytes) { public String deriveP2shAddress(byte[] redeemScriptBytes) {
Context.propagate(bitcoinjContext); Context.propagate(bitcoinjContext);