mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 20:35:13 +00:00
require network to show request status
This commit is contained in:
parent
cbcb799eec
commit
1fbbd5d65d
2 changed files with 13 additions and 9 deletions
|
@ -542,7 +542,7 @@ class Commands:
|
||||||
# """<Not implemented>"""
|
# """<Not implemented>"""
|
||||||
# pass
|
# pass
|
||||||
|
|
||||||
@command('w')
|
@command('wn')
|
||||||
def listrequests(self, pending=False, expired=False, paid=False):
|
def listrequests(self, pending=False, expired=False, paid=False):
|
||||||
"""List the payment requests you made."""
|
"""List the payment requests you made."""
|
||||||
out = self.wallet.get_sorted_requests(self.config)
|
out = self.wallet.get_sorted_requests(self.config)
|
||||||
|
@ -688,10 +688,11 @@ from util import profiler
|
||||||
def get_parser(run_gui, run_daemon, run_cmdline):
|
def get_parser(run_gui, run_daemon, run_cmdline):
|
||||||
# parent parser, because set_default_subparser removes global options
|
# parent parser, because set_default_subparser removes global options
|
||||||
parent_parser = argparse.ArgumentParser('parent', add_help=False)
|
parent_parser = argparse.ArgumentParser('parent', add_help=False)
|
||||||
parent_parser.add_argument("-v", "--verbose", action="store_true", dest="verbose", default=False, help="Show debugging information")
|
group = parent_parser.add_argument_group('global options')
|
||||||
parent_parser.add_argument("-P", "--portable", action="store_true", dest="portable", default=False, help="Use local 'electrum_data' directory")
|
group.add_argument("-v", "--verbose", action="store_true", dest="verbose", default=False, help="Show debugging information")
|
||||||
parent_parser.add_argument("-w", "--wallet", dest="wallet_path", help="wallet path")
|
group.add_argument("-P", "--portable", action="store_true", dest="portable", default=False, help="Use local 'electrum_data' directory")
|
||||||
parent_parser.add_argument("-o", "--offline", action="store_true", dest="offline", default=False, help="Run offline")
|
group.add_argument("-w", "--wallet", dest="wallet_path", help="wallet path")
|
||||||
|
group.add_argument("-o", "--offline", action="store_true", dest="offline", default=False, help="Run offline")
|
||||||
# create main parser
|
# create main parser
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
parents=[parent_parser],
|
parents=[parent_parser],
|
||||||
|
|
|
@ -1261,10 +1261,13 @@ class Abstract_Wallet(object):
|
||||||
timestamp = r.get('timestamp', 0)
|
timestamp = r.get('timestamp', 0)
|
||||||
expiration = r.get('expiration')
|
expiration = r.get('expiration')
|
||||||
if amount:
|
if amount:
|
||||||
paid = amount <= self.get_addr_received(address)
|
if self.up_to_date:
|
||||||
status = PR_PAID if paid else PR_UNPAID
|
paid = amount <= self.get_addr_received(address)
|
||||||
if status == PR_UNPAID and expiration is not None and time.time() > timestamp + expiration:
|
status = PR_PAID if paid else PR_UNPAID
|
||||||
status = PR_EXPIRED
|
if status == PR_UNPAID and expiration is not None and time.time() > timestamp + expiration:
|
||||||
|
status = PR_EXPIRED
|
||||||
|
else:
|
||||||
|
status = PR_UNKNOWN
|
||||||
else:
|
else:
|
||||||
status = PR_UNKNOWN
|
status = PR_UNKNOWN
|
||||||
return status
|
return status
|
||||||
|
|
Loading…
Add table
Reference in a new issue