From 7a2eb925636d27755e31131225b0fbaa53b8e928 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Thu, 1 Jun 2017 16:58:56 -0400 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 d164612e..e2c78e54 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)); + } } } }