コード例 #1
0
ファイル: bitcoin.py プロジェクト: ik1znl/bitcoin-smartcard
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'))
コード例 #2
0
ファイル: bitcoin.py プロジェクト: 12019/bitcoin-smartcard
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'));
コード例 #3
0
ファイル: bitcoin.py プロジェクト: ik1znl/bitcoin-smartcard
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())
コード例 #4
0
ファイル: bitcoin.py プロジェクト: 12019/bitcoin-smartcard
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())