From 113903b714660105e90283dd001b7a9cdf125a2f Mon Sep 17 00:00:00 2001 From: Viktor Date: Fri, 2 Jun 2017 11:59:46 +0300 Subject: [PATCH] Automatically update wallet's cached copy of account objects whenever we are notified of a change on the blockchain --- libraries/wallet/wallet.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 728e0c12..f636d537 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -451,6 +451,20 @@ private: { // idump((e)); } + try + { + object_id_type id = changed_object_variant["id"].as(); + if (_wallet.my_accounts.find(id) != _wallet.my_accounts.end()) + { + account_object account = changed_object_variant.as(); + _wallet.update_account(account); + } + continue; + } + catch (const fc::exception& e) + { + // idump((e)); + } } } }