| @@ 38-54 (lines=17) @@ | ||
| 35 | $this->paginationLimit = $limit; |
|
| 36 | } |
|
| 37 | ||
| 38 | public function getUTXOs(array $addresses) { |
|
| 39 | $results = array(); |
|
| 40 | ||
| 41 | foreach (array_chunk($addresses, 500) as $addresses) { |
|
| 42 | if ($this->debug) { |
|
| 43 | echo "\nchecking " . count($addresses) . " addresses ..."; |
|
| 44 | } |
|
| 45 | //get the utxos for this address |
|
| 46 | $utxos = $this->getUnspentOutputs($addresses); |
|
| 47 | ||
| 48 | if (count($utxos) > 0) { |
|
| 49 | $results = array_merge($results, $utxos); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| 53 | return $results; |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * gets unspent outputs for a batch of addresses, returning and array of outputs with hash, index, value, and script pub hex |
|
| @@ 25-41 (lines=17) @@ | ||
| 22 | $this->sleepTime = 20; |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getUTXOs(array $addresses) { |
|
| 26 | $results = array(); |
|
| 27 | ||
| 28 | foreach (array_chunk($addresses, 500) as $addresses) { |
|
| 29 | if ($this->debug) { |
|
| 30 | echo "\nchecking " . count($addresses) . " addresses ..."; |
|
| 31 | } |
|
| 32 | //get the utxos for this address |
|
| 33 | $utxos = $this->getUnspentOutputs($addresses); |
|
| 34 | ||
| 35 | if (count($utxos) > 0) { |
|
| 36 | $results = array_merge($results, $utxos); |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| 40 | return $results; |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * gets unspent outputs for a batch of addresses, returning and array of outputs with hash, index, value, and script pub hex |
|