Merge pull request #1132 from poolpm/patch-1

[FIX] Wrong behavior on Edit Account with no addy
This commit is contained in:
Sebastian Grewe 2013-12-28 12:18:05 -08:00
commit bac119dcc8

View File

@ -281,20 +281,22 @@ class User extends Base {
$this->setErrorMessage('Invalid email address'); $this->setErrorMessage('Invalid email address');
return false; return false;
} }
if ($this->bitcoin->can_connect() === true && !empty($address)) { if (!empty($address)) {
try { if ($this->bitcoin->can_connect() === true) {
$aStatus = $this->bitcoin->validateaddress($address); try {
if (!$aStatus['isvalid']) { $aStatus = $this->bitcoin->validateaddress($address);
$this->setErrorMessage('Invalid coin address'); if (!$aStatus['isvalid']) {
$this->setErrorMessage('Invalid coin address');
return false;
}
} catch (BitcoinClientException $e) {
$this->setErrorMessage('Unable to verify coin address');
return false; return false;
} }
} catch (BitcoinClientException $e) { } else {
$this->setErrorMessage('Unable to verify coin address'); $this->setErrorMessage('Unable to connect to RPC server for coin address validation');
return false; return false;
} }
} else {
$this->setErrorMessage('Unable to connect to RPC server for coin address validation');
return false;
} }
// Number sanitizer, just in case we fall through above // Number sanitizer, just in case we fall through above