mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-11 13:24:33 +00:00
export/import key images when cold signing
This commit is contained in:
parent
24ccd27d79
commit
ae5c21ef17
3 changed files with 13 additions and 6 deletions
|
@ -69,7 +69,10 @@ QStringList UnsignedTransaction::recipientAddress() const
|
||||||
|
|
||||||
bool UnsignedTransaction::sign(const QString &fileName) const
|
bool UnsignedTransaction::sign(const QString &fileName) const
|
||||||
{
|
{
|
||||||
return m_pimpl->sign(fileName.toStdString());
|
if(!m_pimpl->sign(fileName.toStdString()))
|
||||||
|
return false;
|
||||||
|
// export key images
|
||||||
|
return m_walletImpl->exportKeyImages(fileName.toStdString() + "_keyImages");
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnsignedTransaction::setFilename(const QString &fileName)
|
void UnsignedTransaction::setFilename(const QString &fileName)
|
||||||
|
@ -77,8 +80,8 @@ void UnsignedTransaction::setFilename(const QString &fileName)
|
||||||
m_fileName = fileName;
|
m_fileName = fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
UnsignedTransaction::UnsignedTransaction(Monero::UnsignedTransaction *pt, QObject *parent)
|
UnsignedTransaction::UnsignedTransaction(Monero::UnsignedTransaction *pt, Monero::Wallet *walletImpl, QObject *parent)
|
||||||
: QObject(parent), m_pimpl(pt)
|
: QObject(parent), m_pimpl(pt), m_walletImpl(walletImpl)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,12 +47,13 @@ public:
|
||||||
Q_INVOKABLE void setFilename(const QString &fileName);
|
Q_INVOKABLE void setFilename(const QString &fileName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit UnsignedTransaction(Monero::UnsignedTransaction * pt, QObject *parent = 0);
|
explicit UnsignedTransaction(Monero::UnsignedTransaction * pt, Monero::Wallet *walletImpl, QObject *parent = 0);
|
||||||
~UnsignedTransaction();
|
~UnsignedTransaction();
|
||||||
private:
|
private:
|
||||||
friend class Wallet;
|
friend class Wallet;
|
||||||
Monero::UnsignedTransaction * m_pimpl;
|
Monero::UnsignedTransaction * m_pimpl;
|
||||||
QString m_fileName;
|
QString m_fileName;
|
||||||
|
Monero::Wallet * m_walletImpl;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UNSIGNEDTRANSACTION_H
|
#endif // UNSIGNEDTRANSACTION_H
|
||||||
|
|
|
@ -327,14 +327,17 @@ UnsignedTransaction * Wallet::loadTxFile(const QString &fileName)
|
||||||
{
|
{
|
||||||
qDebug() << "Trying to sign " << fileName;
|
qDebug() << "Trying to sign " << fileName;
|
||||||
Monero::UnsignedTransaction * ptImpl = m_walletImpl->loadUnsignedTx(fileName.toStdString());
|
Monero::UnsignedTransaction * ptImpl = m_walletImpl->loadUnsignedTx(fileName.toStdString());
|
||||||
UnsignedTransaction * result = new UnsignedTransaction(ptImpl, this);
|
UnsignedTransaction * result = new UnsignedTransaction(ptImpl, m_walletImpl, this);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Wallet::submitTxFile(const QString &fileName) const
|
bool Wallet::submitTxFile(const QString &fileName) const
|
||||||
{
|
{
|
||||||
qDebug() << "Trying to submit " << fileName;
|
qDebug() << "Trying to submit " << fileName;
|
||||||
return m_walletImpl->submitTransaction(fileName.toStdString());
|
if (!m_walletImpl->submitTransaction(fileName.toStdString()))
|
||||||
|
return false;
|
||||||
|
// import key images
|
||||||
|
return m_walletImpl->importKeyImages(fileName.toStdString() + "_keyImages");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Wallet::disposeTransaction(PendingTransaction *t)
|
void Wallet::disposeTransaction(PendingTransaction *t)
|
||||||
|
|
Loading…
Reference in a new issue