lndg/delete_payments.py
2022-09-13 15:13:05 -04:00

16 lines
605 B
Python

from gui.lnd_deps import lightning_pb2 as ln
from gui.lnd_deps import lightning_pb2_grpc as lnrpc
from gui.lnd_deps.lnd_connect import lnd_connect
def main():
stub = lnrpc.LightningStub(lnd_connect())
try:
stub.DeleteAllPayments(ln.DeleteAllPaymentsRequest(failed_payments_only=False, failed_htlcs_only=True))
stub.DeleteAllPayments(ln.DeleteAllPaymentsRequest(failed_payments_only=True, failed_htlcs_only=False))
except Exception as e:
print('Exception occured: ', e)
finally:
print('Delete All Payments Completed')
if __name__ == '__main__':
main()