[FIX] Wrong behavior on Edit Account with no addy

When an account is edited and no payment address has been set, the following non-sense message appears:
Unable to connect to RPC server for coin address validation

This patch fixes the issue and allows profile to be edited with no payment address
This commit is contained in:
poolpm 2013-12-27 16:21:25 +01:00
parent 91e7413539
commit c9215475b0

View File

@ -281,7 +281,8 @@ 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)) {
if ($this->bitcoin->can_connect() === true) {
try { try {
$aStatus = $this->bitcoin->validateaddress($address); $aStatus = $this->bitcoin->validateaddress($address);
if (!$aStatus['isvalid']) { if (!$aStatus['isvalid']) {
@ -296,6 +297,7 @@ class User extends Base {
$this->setErrorMessage('Unable to connect to RPC server for coin address validation'); $this->setErrorMessage('Unable to connect to RPC server for coin address validation');
return false; return false;
} }
}
// Number sanitizer, just in case we fall through above // Number sanitizer, just in case we fall through above
$threshold = min($this->config['ap_threshold']['max'], max(0, floatval($threshold))); $threshold = min($this->config['ap_threshold']['max'], max(0, floatval($threshold)));