mirror of
https://github.com/monero-project/monero.git
synced 2025-01-28 18:56:31 +02:00
Added 'on_wallet_refreshed' observer callback
This commit is contained in:
parent
878db6791c
commit
06bddbc7d5
@ -208,7 +208,7 @@ const std::multimap<std::string,Payment> Wallet::getAllPayments()
|
|||||||
|
|
||||||
bool Wallet::refresh() {
|
bool Wallet::refresh() {
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lLockRefresh(refresh_mutex);
|
refresh_mutex.lock();
|
||||||
|
|
||||||
size_t lFetchedBlocks;
|
size_t lFetchedBlocks;
|
||||||
bool lHasReceivedMoney;
|
bool lHasReceivedMoney;
|
||||||
@ -216,6 +216,12 @@ bool Wallet::refresh() {
|
|||||||
|
|
||||||
wallet_impl->refresh(lFetchedBlocks, lHasReceivedMoney, lIsOk);
|
wallet_impl->refresh(lFetchedBlocks, lHasReceivedMoney, lIsOk);
|
||||||
|
|
||||||
|
refresh_mutex.unlock();
|
||||||
|
|
||||||
|
if (lIsOk && observer) {
|
||||||
|
observer->on_wallet_refreshed(this, lFetchedBlocks, lHasReceivedMoney);
|
||||||
|
}
|
||||||
|
|
||||||
return lIsOk;
|
return lIsOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ public:
|
|||||||
virtual void on_skip_transaction(uint64_t height, const std::string& transaction_id) = 0;
|
virtual void on_skip_transaction(uint64_t height, const std::string& transaction_id) = 0;
|
||||||
|
|
||||||
virtual void on_payment_received(uint64_t height, const std::string& payment_id, const Payment& payment) = 0;
|
virtual void on_payment_received(uint64_t height, const std::string& payment_id, const Payment& payment) = 0;
|
||||||
|
|
||||||
|
virtual void on_wallet_refreshed(Monero::Wallet* wallet, size_t fetched_blocks_count, bool hasReceivedMoney) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user