Code Duplication    Length = 11-11 lines in 2 locations

src/Wallet.php 1 location

@@ 367-377 (lines=11) @@
364
     * @return BIP32Key
365
     * @throws \Exception
366
     */
367
    public function getBlocktrailPublicKey($path) {
368
        $path = BIP32Path::path($path);
369
370
        $keyIndex = str_replace("'", "", $path[1]);
371
372
        if (!isset($this->blocktrailPublicKeys[$keyIndex])) {
373
            throw new \Exception("No blocktrail publickey for key index [{$keyIndex}]");
374
        }
375
376
        return $this->blocktrailPublicKeys[$keyIndex];
377
    }
378
379
    /**
380
     * generate a new derived key and return the new path and address for it

src/WalletSweeper.php 1 location

@@ 202-212 (lines=11) @@
199
     * @return BIP32Key
200
     * @throws \Exception
201
     */
202
    protected function getBlocktrailPublicKey($path) {
203
        $path = BIP32Path::path($path);
204
205
        $keyIndex = str_replace("'", "", $path[1]);
206
207
        if (!isset($this->blocktrailPublicKeys[$keyIndex])) {
208
            throw new \Exception("No blocktrail publickey for key index [{$keyIndex}]");
209
        }
210
211
        return $this->blocktrailPublicKeys[$keyIndex];
212
    }
213
214
    /**
215
     * discover funds in the wallet