1
0

Refactor for loop in UTXOList

This refactor makes UTXOList somewhat easier to subclass.
This commit is contained in:
JeremyRand
2019-02-01 06:41:15 +00:00
parent 0f0cee422e
commit 8716bc8cfb

View File

@@ -47,6 +47,9 @@ class UTXOList(MyTreeView):
self.model().clear() self.model().clear()
self.update_headers(self.__class__.headers) self.update_headers(self.__class__.headers)
for idx, x in enumerate(utxos): for idx, x in enumerate(utxos):
self.insert_utxo(idx, x)
def insert_utxo(self, idx, x):
address = x.get('address') address = x.get('address')
height = x.get('height') height = x.get('height')
name = x.get('prevout_hash') + ":%d"%x.get('prevout_n') name = x.get('prevout_hash') + ":%d"%x.get('prevout_n')