aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routes/bitcoin/sweep.js2
-rw-r--r--routes/users.js29
2 files changed, 2 insertions, 29 deletions
diff --git a/routes/bitcoin/sweep.js b/routes/bitcoin/sweep.js
index 8b7bf5aa..0d1d63b1 100644
--- a/routes/bitcoin/sweep.js
+++ b/routes/bitcoin/sweep.js
@@ -78,6 +78,6 @@ module.exports = async (req, res) => {
feeRate = Math.round(feeRate * 1000);
psbt = psbt.toBase64();
- console.log(total);
+ if (balance !== amount) total = 0;
res.send({ feeRate, psbt, total });
};
diff --git a/routes/users.js b/routes/users.js
index 4c39ca07..991f803f 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -72,7 +72,6 @@ app.get("/challenge", async (req, res) => {
app.post("/register", async (req, res) => {
let err = m => res.status(500).send(m);
let { user } = req.body;
- let { token } = user;
if (!user.username) return err("Username required");
@@ -109,32 +108,6 @@ app.post("/register", async (req, res) => {
delete challenge[ip];
- let success, score;
- if (prod) {
- if (!token) return res.status(500).send("Missing captcha token");
-
-
- try {
- const url = `https://www.google.com/recaptcha/api/siteverify?secret=${config.captcha}&response=${token}&remoteip=${ip}`;
- let captcha = await axios.post(url, { timeout: 1000 });
-
- ({ success, score } = captcha.data);
-
- if (!success || score < 0.8) {
- l.warn("failed registration attempt", ip);
-
- if (ip !== "192.168.1.5") {
- const spawn = require("child_process").spawn;
- proc = spawn("iptables", ["-I", "INPUT", "-s", ip, "-j", "DROP"]);
- }
-
- return res.status(500).send("Failed captcha");
- }
- } catch (e) {
- l.error(e.message);
- }
- }
-
let countries = {
CA: "CAD",
US: "USD",
@@ -183,7 +156,7 @@ app.post("/register", async (req, res) => {
user = await getUser(user.username);
res.send(pick(user, ...whitelist));
emit(user.username, "user", user);
- l.info("new user", user.username, ip, score);
+ l.info("new user", user.username, ip);
});
app.post("/disable2fa", auth, twofa, async (req, res) => {