mirror of
https://git.wownero.com/wownero/wownerowp.git
synced 2024-08-15 01:03:16 +00:00
add zero_conf option to get_outputs
This commit is contained in:
parent
b30ee78993
commit
4cbcde5e7b
1 changed files with 18 additions and 5 deletions
|
@ -366,14 +366,27 @@ class NodeTools
|
|||
return $array['data']['txs'];
|
||||
}
|
||||
|
||||
public function get_outputs($address, $viewkey)
|
||||
public function get_outputs($address, $viewkey, $zero_conf = false)
|
||||
{
|
||||
$curl = curl_init();
|
||||
|
||||
if(!$zero_conf)
|
||||
{
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_RETURNTRANSFER => 1,
|
||||
CURLOPT_URL => $this->url . '/api/outputsblocks?address=' . $address . '&viewkey=' . $viewkey . '&limit=5&mempool=0',
|
||||
));
|
||||
}
|
||||
|
||||
// also look in mempool if accepting zero confirmation transactions
|
||||
if($zero_conf)
|
||||
{
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_RETURNTRANSFER => 1,
|
||||
CURLOPT_URL => $this->url . '/api/outputsblocks?address=' . $address . '&viewkey=' . $viewkey . '&limit=5&mempool=1',
|
||||
));
|
||||
}
|
||||
|
||||
$resp = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue