From f090c783cc29cc0e85238435b2bffb11d0825d21 Mon Sep 17 00:00:00 2001 From: aspect Date: Thu, 4 Jul 2013 01:46:23 -0400 Subject: [PATCH] Adding withdraw limit --- testnet.js | 6 +++--- views/index.ejs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testnet.js b/testnet.js index 3551f0d..28119fa 100644 --- a/testnet.js +++ b/testnet.js @@ -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) @@ -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)); @@ -121,6 +119,8 @@ function Application() { if(err) return res.end(JSON.stringify(err)); + limits[ip] += to_send; + res.end(JSON.stringify(txinfo)); }) diff --git a/views/index.ejs b/views/index.ejs index 4bf4e24..d3575cf 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -124,7 +124,7 @@ BALANCE (1 confirms):
SEND -Limit: 100 coins per IP.
+Limit: 1000 coins per IP.
TO ADDRESS: AMOUNT: