From 85055fbdad90a77b8419e028dfcfc379a3a74c59 Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 11 Aug 2019 09:52:53 -0400 Subject: [PATCH] return last height from wait_for_next_block() --- src/wallet/monero_wallet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/monero_wallet.cpp b/src/wallet/monero_wallet.cpp index f44af35..4ea167d 100644 --- a/src/wallet/monero_wallet.cpp +++ b/src/wallet/monero_wallet.cpp @@ -2504,10 +2504,10 @@ namespace monero { struct block_notifier : monero_wallet_listener { boost::mutex* temp; boost::condition_variable* cv; + uint64_t last_height; block_notifier(boost::mutex* temp, boost::condition_variable* cv) { this->temp = temp; this->cv = cv; } void on_new_block(uint64_t height) { - cout << "ON NEW BLOCK!!!! " << height << endl; - //boost::lock_guard guarg(*temp); + last_height = height; cv->notify_one(); } } block_listener(&temp, &cv); @@ -2522,8 +2522,8 @@ namespace monero { // unregister the listener remove_listener(block_listener); - // return notified height - return 0; // TODO + // return last height + return block_listener.last_height; } void monero_wallet::move_to(string path, string password) {