Handbook
Glossary
verify-block ( peer -- peer )
Vocabulary
bittorrent
Inputs
peer
an
object
Outputs
peer
an
object
Definition
USING:
accessors
assocs
checksums
checksums.sha
kernel
math
sequences
;
IN:
bittorrent
::
verify-block
( peer -- peer )
peer
current-piece>>
sha1
checksum-bytes
peer
current-index>>
20
*
dup
20
+
peer
torrent>>
metainfo>>
{
"info"
"pieces"
}
[
of
]
each
B{
}
subseq-as
assert=
peer
;