From 98612dbd811e9bee14e7585627c70141e366fa4e Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Wed, 29 May 2019 11:19:39 +0530 Subject: [PATCH] Updating TOken db folder during API calls --- ranchimallflo_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ranchimallflo_api.py b/ranchimallflo_api.py index e389101..df124f1 100644 --- a/ranchimallflo_api.py +++ b/ranchimallflo_api.py @@ -31,7 +31,7 @@ def getaddressbalance(): if address is None or token is None: return jsonify(result='error') - dblocation = dbfolder + token + '.db' + dblocation = dbfolder + '/tokens/' + str(token) + '.db' if os.path.exists(dblocation): conn = sqlite3.connect(dblocation) c = conn.cursor() @@ -61,7 +61,7 @@ def gettokeninfo(): c.execute('SELECT COUNT (DISTINCT address) FROM activeTable') numberOf_distinctAddresses = c.fetchall()[0][0] conn.close() - return jsonify(result='ok', token=token, incorporationAddress=incorporationRow[2], tokenSupply=incorporationRow[3], + return jsonify(result='ok', token=token, incorporationAddress=incorporationRow[1], tokenSupply=incorporationRow[3], transactionHash=incorporationRow[6], blockchainReference=incorporationRow[7], activeAddress_no=numberOf_distinctAddresses) @@ -75,7 +75,7 @@ def gettransactions(): if token is None: return jsonify(result='error') - dblocation = dbfolder + token + '.db' + dblocation = dbfolder + '/tokens/' + str(token) + '.db' if os.path.exists(dblocation): conn = sqlite3.connect(dblocation) conn.row_factory = sqlite3.Row