| @@ 125-145 (lines=21) @@ | ||
| 122 | * @return array |
|
| 123 | * @throws \Exception |
|
| 124 | */ |
|
| 125 | protected function normalizeNetwork($network, $testnet) { |
|
| 126 | switch (strtolower($network)) { |
|
| 127 | case 'btc': |
|
| 128 | case 'bitcoin': |
|
| 129 | $network = 'bitcoin'; |
|
| 130 | ||
| 131 | break; |
|
| 132 | ||
| 133 | case 'tbtc': |
|
| 134 | case 'bitcoin-testnet': |
|
| 135 | $network = 'bitcoin'; |
|
| 136 | $testnet = true; |
|
| 137 | ||
| 138 | break; |
|
| 139 | ||
| 140 | default: |
|
| 141 | throw new \Exception("Unknown network [{$network}]"); |
|
| 142 | } |
|
| 143 | ||
| 144 | return [$network, $testnet]; |
|
| 145 | } |
|
| 146 | ||
| 147 | ||
| 148 | /** |
|
| @@ 85-105 (lines=21) @@ | ||
| 82 | * @return array |
|
| 83 | * @throws \Exception |
|
| 84 | */ |
|
| 85 | protected function normalizeNetwork($network, $testnet) { |
|
| 86 | switch (strtolower($network)) { |
|
| 87 | case 'btc': |
|
| 88 | case 'bitcoin': |
|
| 89 | $network = 'bitcoin'; |
|
| 90 | ||
| 91 | break; |
|
| 92 | ||
| 93 | case 'tbtc': |
|
| 94 | case 'bitcoin-testnet': |
|
| 95 | $network = 'bitcoin'; |
|
| 96 | $testnet = true; |
|
| 97 | ||
| 98 | break; |
|
| 99 | ||
| 100 | default: |
|
| 101 | throw new \Exception("Unknown network [{$network}]"); |
|
| 102 | } |
|
| 103 | ||
| 104 | return [$network, $testnet]; |
|
| 105 | } |
|
| 106 | ||
| 107 | /** |
|
| 108 | * set BitcoinLib to the correct magic-byte defaults for the selected network |
|