Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e07971b

Browse files
committed
fix checking of accounts
1 parent c10cb07 commit e07971b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/bitcoin.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ class BitcoinClient extends jsonrpc_client {
826826
* @since 0.3.18
827827
*/
828828
public function sendfrom($account, $toaddress, $amount, $minconf = 1, $comment = NULL, $comment_to = NULL) {
829-
if (!$account || !$toaddress || empty($toaddress) || !$amount || !is_numeric($amount) || $amount <= 0)
829+
if (is_null($account) || !$toaddress || empty($toaddress) || !$amount || !is_numeric($amount) || $amount <= 0)
830830
throw new BitcoinClientException("sendfrom requires a from account, to account and numeric amount > 0");
831831
if (!is_numeric($minconf) || $minconf < 0)
832832
throw new BitcoinClientException('sendfrom requires a numeric $minconf >= 0');
@@ -948,7 +948,7 @@ class BitcoinClient extends jsonrpc_client {
948948
* @author codler<github>
949949
*/
950950
public function sendmany($fromAccount, $sendTo, $minconf = 1, $comment=NULL) {
951-
if (!$fromAccount || empty($fromAccount))
951+
if (is_null($fromAccount))
952952
throw new BitcoinClientException("sendmany requires an account");
953953
if (!is_numeric($minconf) || $minconf < 0)
954954
throw new BitcoinClientException('sendmany requires a numeric minconf >= 0');
@@ -958,4 +958,4 @@ class BitcoinClient extends jsonrpc_client {
958958
return $this->query("sendmany", $fromAccount, $sendTo, $minconf, $comment);
959959
}
960960

961-
}
961+
}

0 commit comments

Comments
 (0)