Example #1
0
 def dispatch_request(self, id):
     super(WalletSendView, self).dispatch_request(id)
     form = SendForm(request.form)
     balance = self.conn.getbalance()
     if request.method == 'POST' and form.validate():
         amount = strtofloat(form.data['amount'])
         txid = self.conn.sendtoaddress(form.toaddress.data, amount,
                                        form.comment.data, form.to.data)
         flash(u"%f coins sent to %s" % (amount, form.toaddress.data),
               'success')
         return redirect(url_for("wallet.tx_detail", id=id, txid=txid))
     return render_template('wallet/wallet/send.html',
                            wallet=self.wallet,
                            form=form,
                            balance=balance)
Example #2
0
 def dispatch_request(self, id):
     super(WalletSendView, self).dispatch_request(id)
     form = SendForm(request.form)
     balance = self.conn.getbalance()
     if request.method == 'POST' and form.validate():
         amount = strtofloat(form.data['amount'])
         txid = self.conn.sendtoaddress(
             form.toaddress.data,
             amount,
             form.comment.data,
             form.to.data
         )
         flash(u"%f coins sent to %s" % (amount, form.toaddress.data),
               'success')
         return redirect(url_for("wallet.tx_detail", id=id, txid=txid))
     return render_template('wallet/wallet/send.html', wallet=self.wallet,
                            form=form, balance=balance)