From 2b75b330bd0477473d42db4b2748ab184151adad Mon Sep 17 00:00:00 2001 From: MMGen Date: Wed, 3 Jul 2019 17:46:23 +0000 Subject: [PATCH] TwUnspentOutputs: make self.total a property --- mmgen/tw.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mmgen/tw.py b/mmgen/tw.py index ab476315..44461277 100755 --- a/mmgen/tw.py +++ b/mmgen/tw.py @@ -92,7 +92,6 @@ watch-only wallet using '{}-addrimport' and then re-run this program. self.age_fmt = 'days' self.sort_key = 'age' self.do_sort() - self.total = self.get_total_coin() self.disp_prec = self.get_display_precision() @property @@ -109,7 +108,8 @@ watch-only wallet using '{}-addrimport' and then re-run this program. def get_display_precision(self): return g.proto.coin_amt.max_prec - def get_total_coin(self): + @property + def total(self): return sum(i.amt for i in self.unspent) def get_unspent_rpc(self): @@ -377,7 +377,6 @@ watch-only wallet using '{}-addrimport' and then re-run this program. if TrackingWallet(mode='w').remove_address(e.addr): self.get_unspent_data() self.do_sort() - self.total = self.get_total_coin() oneshot_msg = yellow("{} #{} removed\n\n".format(capfirst(self.item_desc),idx)) else: oneshot_msg = red('Address could not be removed\n\n')