|
|
@ -435,6 +435,27 @@ double Settings::getMinerFee() { |
|
|
|
return 0.0001; |
|
|
|
} |
|
|
|
|
|
|
|
bool Settings::isValidTransparentPrivateKey(QString pk) { |
|
|
|
if (pk.length() > 52) { |
|
|
|
DEBUG("privkey invalid, too long"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (pk.length() < 51) { |
|
|
|
DEBUG("privkey invalid, too short"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// TODO: can a taddr privkey start with anything else?
|
|
|
|
if (pk.startsWith("U") || pk.startsWith("5") || pk.startsWith("L") || pk.startsWith("K") || pk.startsWith("7")) { |
|
|
|
// TODO: verify only contains base58 characters
|
|
|
|
return true; |
|
|
|
} else { |
|
|
|
DEBUG("privkey invalid, wrong prefix"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
bool Settings::isValidSaplingPrivateKey(QString pk) { |
|
|
|
if (isTestnet()) { |
|
|
|
QRegExp zspkey("^secret-extended-key-test[0-9a-z]{278}$", Qt::CaseInsensitive); |
|
|
|