From 7101db060bdda38d9c05232e9a313b2cc9e9a853 Mon Sep 17 00:00:00 2001 From: gdassori Date: Sun, 28 Jan 2018 14:46:52 +0100 Subject: [PATCH] add mutually exclusive bolt11 & payment_hash to listpayments method --- contrib/pylightning/lightning/lightning.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/pylightning/lightning/lightning.py b/contrib/pylightning/lightning/lightning.py index 127cabf30..0af8ec7b3 100644 --- a/contrib/pylightning/lightning/lightning.py +++ b/contrib/pylightning/lightning/lightning.py @@ -217,11 +217,15 @@ class LightningRpc(UnixDomainSocketRpc): riskfactor is not None and args.append(riskfactor) return self._call("pay", args=args) - def listpayments(self): + def listpayments(self, bolt11=None, payment_hash=None): """ - Show outgoing payments + Show outgoing payments, regarding {bolt11} or {payment_hash} if set + Can only specify one of {bolt11} or {payment_hash} """ - return self._call("listpayments") + args = [] + bolt11 and args.append(bolt11) + payment_hash and args.append(payment_hash) if args else args.extend([bolt11, payment_hash]) + return self._call("listpayments", args=args) def connect(self, peer_id, host=None, port=None): """