mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-17 15:21:30 +02:00
support get_height_by_date(year, month, day)
This commit is contained in:
@@ -381,6 +381,18 @@ namespace monero {
|
||||
virtual uint64_t get_daemon_max_peer_height() const {
|
||||
throw std::runtime_error("get_daemon_max_peer_height() not supported");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the blockchain's height by date.
|
||||
*
|
||||
* @param year - year of the height to get
|
||||
* @param month - month of the height to get as a number between 1 and 12
|
||||
* @param day - day of the height to get as a number between 1 and 31
|
||||
* @return the blockchain's height at the given date
|
||||
*/
|
||||
virtual uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const {
|
||||
throw std::runtime_error("get_height_by_date(year, month, day) not supported");
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a listener receive wallet notifications.
|
||||
|
||||
@@ -1265,6 +1265,10 @@ namespace monero {
|
||||
if (result == 0) result = get_daemon_height(); // TODO monero core: target height can be 0 when daemon is synced. Use blockchain height instead
|
||||
return result;
|
||||
}
|
||||
|
||||
uint64_t monero_wallet_core::get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const {
|
||||
return m_w2->get_blockchain_height_by_date(year, month, day);
|
||||
}
|
||||
|
||||
void monero_wallet_core::add_listener(monero_wallet_listener& listener) {
|
||||
MTRACE("add_listener()");
|
||||
|
||||
@@ -196,6 +196,7 @@ namespace monero {
|
||||
void set_sync_height(uint64_t sync_height) override;
|
||||
uint64_t get_daemon_height() const override;
|
||||
uint64_t get_daemon_max_peer_height() const override;
|
||||
uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const override;
|
||||
void add_listener(monero_wallet_listener& listener) override;
|
||||
void remove_listener(monero_wallet_listener& listener) override;
|
||||
std::set<monero_wallet_listener*> get_listeners() override;
|
||||
|
||||
Reference in New Issue
Block a user