FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PacketCrypt/src/PoolProto.h at develop · javascriptit/PacketCrypt · GitHub
javascriptit
PacketCrypt
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PacketCrypt
/
src
/
PoolProto.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (30 loc) · 1.04 KB
Breadcrumbs
PacketCrypt
/
src
/
PoolProto.h
Copy path
File metadata and controls
35 lines (30 loc) · 1.04 KB
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
/**
* (C) Copyright 2019
* Caleb James DeLisle
*
* SPDX-License-Identifier: (LGPL-2.1-only OR LGPL-3.0-only)
*/
#ifndef
POOLPROTO_H
#define
POOLPROTO_H
#include
"packetcrypt/PacketCrypt.h"
#include
"Buf.h"
typedef
struct
PoolProto_Work_t
{
PacketCrypt_BlockHeader_t
blkHdr
;
Buf32_t
contentHash
;
uint32_t
shareTarget
;
uint32_t
annTarget
;
int32_t
height
;
uint32_t
coinbaseLen
;
uint8_t
coinbaseAndMerkles
[];
}
PoolProto_Work_t
;
static
inline
bool
PoolProto_Work_isValid
(
int
totalLen
,
PoolProto_Work_t
*
work
) {
if
(
totalLen
<
(
int
)
sizeof
(
PoolProto_Work_t
)) {
return
false; }
if
(
totalLen
<
((
int
)
sizeof
(
PoolProto_Work_t
)
+
(
int
)
work
->
coinbaseLen
)) {
return
false; }
if
((
totalLen
-
(
int
)
sizeof
(
PoolProto_Work_t
)
-
work
->
coinbaseLen
) %
32
) {
return
false; }
return
true;
}
static
inline
int
PoolProto_Work_merkleCount
(
int
totalLen
,
PoolProto_Work_t
*
work
) {
if
(!
PoolProto_Work_isValid
(
totalLen
,
work
)) {
return
-1
; }
return
(
totalLen
-
(
int
)
sizeof
(
PoolProto_Work_t
)
-
work
->
coinbaseLen
) /
32
;
}
#endif
Back
|
FazBrowse Home
|
New Git URL