Skip to content

Commit

Permalink
Adding withdraw limit
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Jul 4, 2013
1 parent d5bdc42 commit f090c78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions testnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Application() {

var ip = get_client_ip(req);

var limit = 100;
var limit = 1000;

var amount = parseFloat(req.query.amount);
if(amount > limit)
Expand All @@ -111,8 +111,6 @@ function Application() {
if(to_send <= 0)
return res.end(JSON.stringify({ error : 'maximum amount exceeded, already sent '+limits[ip]+' coins'}));

limits[ip] += to_send;

self.client.sendToAddress(req.query.address, to_send ,'', function(err, txhash) {
if(err)
return res.end(JSON.stringify(err));
Expand All @@ -121,6 +119,8 @@ function Application() {
if(err)
return res.end(JSON.stringify(err));

limits[ip] += to_send;

res.end(JSON.stringify(txinfo));
})

Expand Down
2 changes: 1 addition & 1 deletion views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ BALANCE (1 confirms): <span id='balance_1'></span>
</fieldset>
<br/>
<fieldset><legend>SEND</legend>
Limit: 100 coins per IP.<br/>
Limit: 1000 coins per IP.<br/>
TO ADDRESS: <input id='send_address' type='text' style='width:300px;'/>
AMOUNT: <input id='send_amount' type='text' />
<button id='send'>SEND</button>
Expand Down

0 comments on commit f090c78

Please sign in to comment.