From c2c6797f972e00d1a7d45f0c06a035b475869632 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Mon, 29 Oct 2018 23:16:39 +0100 Subject: [PATCH] wowlight version check API route --- funding/api.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/funding/api.py b/funding/api.py index 97f9476..66c086d 100644 --- a/funding/api.py +++ b/funding/api.py @@ -64,3 +64,24 @@ def api_qr_generate(address): raise Exception('Could not create QR code') return send_from_directory('static/qr', '%s.png' % address) + + +@app.route('/api/1/wowlight') +@endpoint.api( + parameter('version', type=str, location='args', required=True) +) +def api_wowlight_version_check(version): + """ + Checks incoming wowlight wallet version, returns False when the version is + too old and needs to be upgraded (due to hard-forks) + :param version: + :return: bool + """ + versions = { + '0.1.0': True + } + + if version not in versions: + return False + + return versions[version]