Browse Source

php - add a simple btc test for pplns2, the same as ckdb

master
kanoi 9 years ago
parent
commit
e1dc5b629e
  1. 15
      pool/base.php
  2. 4
      pool/page_pplns2.php

15
pool/base.php

@ -272,6 +272,21 @@ function safepass($pass)
return true;
}
#
# simple test without checksum validation
function btcaddr($addr)
{
$c0 = substr($addr, 0, 1);
if ($c0 != '1' && $c0 != '3')
return false;
$len = strlen($addr);
if ($len <= 26 || $len >= 37)
return false;
$rem = preg_replace('/[A-HJ-NP-Za-km-z1-9]/', '', $addr);
if (strlen($rem) > 0)
return false;
return true;
}
#
function bademail($email, $isold = false)
{
if ($email == null || $email == '')

4
pool/page_pplns2.php

@ -51,10 +51,8 @@ function calctx($ans, $count, $miner_sat, $diffacc_total)
}
if ($payaddress == 'none')
{
$c0 = substr($username, 0, 1);
$parts = explode('.', $username);
$len = strlen($parts[0]);
if (($c0 == '1' || $c0 == '3') && $len > 26 && $len < 37)
if (btcaddr($parts[0]) === true)
$payaddress = $parts[0];
else
{

Loading…
Cancel
Save