本文整理汇总了PHP中jsonRPCClient::importaddress方法的典型用法代码示例。如果您正苦于以下问题:PHP jsonRPCClient::importaddress方法的具体用法?PHP jsonRPCClient::importaddress怎么用?PHP jsonRPCClient::importaddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsonRPCClient
的用法示例。
在下文中一共展示了jsonRPCClient::importaddress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_address
public function add_address($wallet_id, $address, $userid = 0, $is_change_address = 0, $address_num = 0, $key_id = 0)
{
// Initialize
global $config;
// Add address to db
DB::insert('coin_addresses', array('wallet_id' => $wallet_id, 'key_id' => $key_id, 'userid' => $userid, 'is_change_address' => $is_change_address, 'address_num' => $address_num, 'address' => $address));
// Init RPC client
include_once SITE_PATH . '/data/lib/jsonRPCClient.php';
$rpc_url = 'http://' . $config['btc_rpc_user'] . ':' . $config['btc_rpc_pass'] . '@' . $config['btc_rpc_host'] . ':' . $config['btc_rpc_port'];
$client = new jsonRPCClient($rpc_url);
// Import address to bitcoind
try {
$client->importaddress($address, "", false);
} catch (Exception $e) {
trigger_error("Unable to import address into Bitcoin Core as a watch only address, {$address}. Please ensure Bitcoin Core is running, and in the correct mode (mainnet / testnet).", E_USER_ERROR);
}
}