def transaction(): balance = tx.balance() try: if tx.balance() < float(request.form['amount']): return render_template('index.html', error="Not enough funds available", amount=request.form['amount'], address=request.form['address'], balance=balance) tx.write_transaction(request.form['address'], float(request.form['amount'])) except tx.InvalidAddress: return render_template('index.html', error="Invalid to address", amount=request.form['amount'], address=request.form['address'], balance=balance) except ValueError: return render_template('index.html', error="Invalid amount", amount=request.form['amount'], address=request.form['address'], balance=balance) subprocess.call(['~/capstone/src/bitcoin_usb.sh'], shell=True) return redirect(url_for('status'))
def transaction(): balance = tx.balance() try: if tx.balance() < float(request.form['amount']): return render_template('index.html',error="Not enough funds available", amount=request.form['amount'], address=request.form['address'], balance=balance) tx.write_transaction(request.form['address'], float(request.form['amount'])) except tx.InvalidAddress: return render_template('index.html',error="Invalid to address", amount=request.form['amount'], address=request.form['address'], balance=balance) except ValueError: return render_template('index.html',error="Invalid amount", amount=request.form['amount'], address=request.form['address'], balance=balance) subprocess.call(['~/capstone/src/bitcoin_usb.sh'],shell=True) return redirect(url_for('status'));
def home(): url_for('static', filename='bitcoin-logo.jpg') balance = tx.balance() return render_template('index.html', error=None, balance=balance, transactions=tx.get_transactions())
def home(): url_for('static', filename='bitcoin-logo.jpg') balance = tx.balance() return render_template('index.html',error=None, balance=balance, transactions=tx.get_transactions())