diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index be379cb9..5a0642f3 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -144,6 +144,12 @@ std::string Wallet::genPaymentId() } +bool Wallet::paymentIdValid(const string &paiment_id) +{ + crypto::hash8 pid; + return tools::wallet2::parse_short_payment_id(paiment_id, pid); +} + ///////////////////////// WalletImpl implementation //////////////////////// WalletImpl::WalletImpl(bool testnet) diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h index 66987e4c..fefdf98c 100644 --- a/src/wallet/wallet2_api.h +++ b/src/wallet/wallet2_api.h @@ -175,6 +175,7 @@ struct Wallet static uint64_t amountFromString(const std::string &amount); static uint64_t amountFromDouble(double amount); static std::string genPaymentId(); + static bool paymentIdValid(const std::string &paiment_id); // TODO? // virtual uint64_t unlockedDustBalance() const = 0;