Wallet: moneySpent, moneyReceived, newBlock signals

This commit is contained in:
Ilya Kitaev 2016-09-23 23:51:24 +03:00
parent 86a6bfbff1
commit 7e769b3a87
3 changed files with 20 additions and 8 deletions

View file

@ -1,8 +1,10 @@
#!/bin/bash #!/bin/bash
MONERO_URL=https://github.com/monero-project/monero.git # MONERO_URL=https://github.com/monero-project/monero.git
MONERO_BRANCH=master # MONERO_BRANCH=master
MONERO_URL=https://github.com/mbg033/monero.git
MONERO_BRANCH=develop
# thanks to SO: http://stackoverflow.com/a/20283965/4118915 # thanks to SO: http://stackoverflow.com/a/20283965/4118915
CPU_CORE_COUNT=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu) CPU_CORE_COUNT=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
pushd $(pwd) pushd $(pwd)

View file

@ -25,18 +25,22 @@ public:
virtual void moneySpent(const std::string &txId, uint64_t amount) virtual void moneySpent(const std::string &txId, uint64_t amount)
{ {
// TODO
Q_UNUSED(txId)
Q_UNUSED(amount)
qDebug() << __FUNCTION__; qDebug() << __FUNCTION__;
emit m_wallet->moneySpent(QString::fromStdString(txId), amount);
} }
virtual void moneyReceived(const std::string &txId, uint64_t amount) virtual void moneyReceived(const std::string &txId, uint64_t amount)
{ {
// TODO
Q_UNUSED(txId)
Q_UNUSED(amount)
qDebug() << __FUNCTION__; qDebug() << __FUNCTION__;
emit m_wallet->moneyReceived(QString::fromStdString(txId), amount);
}
virtual void newBlock(uint64_t height)
{
qDebug() << __FUNCTION__;
emit m_wallet->newBlock(height);
} }
virtual void updated() virtual void updated()

View file

@ -113,12 +113,18 @@ public:
// TODO: setListenter() when it implemented in API // TODO: setListenter() when it implemented in API
signals: signals:
// emitted on every event happened with wallet
// (money sent/received, new block)
void updated(); void updated();
// emitted when refresh process finished (could take a long time) // emitted when refresh process finished (could take a long time)
// signalling only after we // signalling only after we
void refreshed(); void refreshed();
void moneySpent(const QString &txId, quint64 amount);
void moneyReceived(const QString &txId, quint64 amount);
void newBlock(quint64 height);
private: private:
Wallet(Bitmonero::Wallet *w, QObject * parent = 0); Wallet(Bitmonero::Wallet *w, QObject * parent = 0);