wallet: simplify get_payment_status
This commit is contained in:
@@ -1614,17 +1614,12 @@ class Abstract_Wallet(AddressSynchronizer, ABC):
|
|||||||
raise Exception("this wallet cannot delete addresses")
|
raise Exception("this wallet cannot delete addresses")
|
||||||
|
|
||||||
def get_payment_status(self, address, amount):
|
def get_payment_status(self, address, amount):
|
||||||
local_height = self.get_local_height()
|
|
||||||
received, sent = self.get_addr_io(address)
|
received, sent = self.get_addr_io(address)
|
||||||
l = []
|
l = []
|
||||||
for txo, x in received.items():
|
for txo, x in received.items():
|
||||||
h, v, is_cb = x
|
h, v, is_cb = x
|
||||||
txid, n = txo.split(':')
|
txid, n = txo.split(':')
|
||||||
info = self.db.get_verified_tx(txid)
|
conf = self.get_tx_height(txid).conf
|
||||||
if info:
|
|
||||||
conf = local_height - info.height + 1
|
|
||||||
else:
|
|
||||||
conf = 0
|
|
||||||
l.append((conf, v))
|
l.append((conf, v))
|
||||||
vsum = 0
|
vsum = 0
|
||||||
for conf, v in reversed(sorted(l)):
|
for conf, v in reversed(sorted(l)):
|
||||||
|
|||||||
Reference in New Issue
Block a user