FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bitcoin-php/src/Script/ScriptWitness.php at 1.0 · Bit-Wasp/bitcoin-php · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
Bit-Wasp
/
bitcoin-php
Public
Notifications
You must be signed in to change notification settings
Fork
446
Star
1.1k
Code
Issues
67
Pull requests
19
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
bitcoin-php
/
src
/
Script
/
ScriptWitness.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (33 loc) · 987 Bytes
Breadcrumbs
bitcoin-php
/
src
/
Script
/
ScriptWitness.php
Copy path
File metadata and controls
40 lines (33 loc) · 987 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare
(strict_types=
1
);
namespace
BitWasp
\
Bitcoin
\
Script
;
use
BitWasp
\
Bitcoin
\
Collection
\
StaticBufferCollection
;
use
BitWasp
\
Bitcoin
\
Serializer
\
Script
\
ScriptWitnessSerializer
;
use
BitWasp
\
Buffertools
\
BufferInterface
;
class
ScriptWitness
extends
StaticBufferCollection
implements
ScriptWitnessInterface
{
/**
* @param ScriptWitnessInterface $witness
* @return bool
*/
public
function
equals
(
ScriptWitnessInterface
$
witness
):
bool
{
$
nStack
=
count
(
$
this
);
if
(
$
nStack
!==
count
(
$
witness
)) {
return
false
;
}
for
(
$
i
=
0
;
$
i
<
$
nStack
;
$
i
++) {
if
(
false
===
$
this
->
offsetGet
(
$
i
)->
equals
(
$
witness
->
offsetGet
(
$
i
))) {
return
false
;
}
}
return
true
;
}
/**
* @return \BitWasp\Buffertools\BufferInterface
*/
public
function
getBuffer
():
BufferInterface
{
return
(
new
ScriptWitnessSerializer
())->
serialize
(
$
this
);
}
}
Back
|
FazBrowse Home
|
New Git URL