tMerge pull request #1135 from Kausheel/get_addr_received - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit eac3129cba68ff1dd216ce67c2ae02b74c2b18d2
DIR parent 21b2fcbe85b1acf12c46ecdf83461538a925931f
HTML Author: ThomasV <electrumdev@gmail.com>
Date: Sun, 19 Apr 2015 13:38:45 +0200
Merge pull request #1135 from Kausheel/get_addr_received
Add wallet function get_addr_received()
Diffstat:
M lib/wallet.py | 10 ++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)
---
DIR diff --git a/lib/wallet.py b/lib/wallet.py
t@@ -487,6 +487,16 @@ class Abstract_Wallet(object):
coins.pop(txi)
return coins.items()
+ #return the total amount ever received by an address
+ def get_addr_received(self, address):
+ h = self.history.get(address, [])
+ received = 0
+ for tx_hash, height in h:
+ l = self.txo.get(tx_hash, {}).get(address, [])
+ for n, v, is_cb in l:
+ received += v
+ return received
+
def get_addr_balance(self, address):
"returns the confirmed balance and pending (unconfirmed) balance change of a bitcoin address"
coins = self.get_addr_utxo(address)