Spend proof

This commit is contained in:
stoffu
2017-11-20 16:12:36 +09:00
parent d9d2050f29
commit 5cda1f5ac1
4 changed files with 47 additions and 9 deletions

View File

@@ -523,6 +523,22 @@ QString Wallet::checkTxProof(const QString &txid, const QString &address, const
return QString::fromStdString(result);
}
Q_INVOKABLE QString Wallet::getSpendProof(const QString &txid, const QString &message) const
{
std::string result = m_walletImpl->getSpendProof(txid.toStdString(), message.toStdString());
if (result.empty())
result = "error|" + m_walletImpl->errorString();
return QString::fromStdString(result);
}
Q_INVOKABLE QString Wallet::checkSpendProof(const QString &txid, const QString &message, const QString &signature) const
{
bool good;
bool success = m_walletImpl->checkSpendProof(txid.toStdString(), message.toStdString(), signature.toStdString(), good);
std::string result = std::string(success ? "true" : "false") + "|" + std::string(!success ? m_walletImpl->errorString() : good ? "true" : "false");
return QString::fromStdString(result);
}
QString Wallet::signMessage(const QString &message, bool filename) const
{
if (filename) {

View File

@@ -235,6 +235,8 @@ public:
Q_INVOKABLE QString checkTxKey(const QString &txid, const QString &tx_key, const QString &address);
Q_INVOKABLE QString getTxProof(const QString &txid, const QString &address, const QString &message) const;
Q_INVOKABLE QString checkTxProof(const QString &txid, const QString &address, const QString &message, const QString &signature);
Q_INVOKABLE QString getSpendProof(const QString &txid, const QString &message) const;
Q_INVOKABLE QString checkSpendProof(const QString &txid, const QString &message, const QString &signature) const;
// Rescan spent outputs
Q_INVOKABLE bool rescanSpent();