@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | rewind($stream); |
55 | 55 | |
56 | 56 | return $segwit ? |
57 | - self::parseSegWit($stream, $testnet) : |
|
58 | - self::parseLegacy($stream, $testnet); |
|
57 | + self::parseSegWit($stream, $testnet) : self::parseLegacy($stream, $testnet); |
|
59 | 58 | } |
60 | 59 | |
61 | 60 | public function serialize(): string |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | $witness .= Encoding::encodeVarInt(\count($txIn->witness)); |
75 | 74 | foreach ($txIn->witness as $element) { |
76 | 75 | $witness .= \is_int($element) ? |
77 | - Encoding::toLE(gmp_init($element)) : |
|
78 | - Encoding::encodeVarInt(\strlen($element)).$element; |
|
76 | + Encoding::toLE(gmp_init($element)) : Encoding::encodeVarInt(\strlen($element)).$element; |
|
79 | 77 | } |
80 | 78 | } |
81 | 79 | } |
@@ -92,12 +90,12 @@ discard block |
||
92 | 90 | |
93 | 91 | public function isCoinbase(): bool |
94 | 92 | { |
95 | - return 1 === \count($this->txIns) |
|
93 | + return 1 === \count($this->txIns) |
|
96 | 94 | && '0000000000000000000000000000000000000000000000000000000000000000' === $this->txIns[0]->prevTxId |
97 | - && 0xFFFFFFFF === $this->txIns[0]->prevIndex; |
|
95 | + && 0xFFFFFFFF === $this->txIns[0]->prevIndex; |
|
98 | 96 | } |
99 | 97 | |
100 | - public function blockHeight(): int|false |
|
98 | + public function blockHeight(): int | false |
|
101 | 99 | { |
102 | 100 | if (!$this->isCoinbase()) { |
103 | 101 | return false; |