Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
Merge Wallet
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Boards
Labels
Milestones
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Merge
Merge Wallet
Commits
14786fee
Commit
14786fee
authored
Jul 01, 2020
by
barrystyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug stake modifier
parent
20dd70f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
configure.ac
configure.ac
+1
-1
src/kernel.cpp
src/kernel.cpp
+10
-0
No files found.
configure.ac
View file @
14786fee
...
...
@@ -4,7 +4,7 @@ define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE,
fals
e)
define(_CLIENT_VERSION_IS_RELEASE,
tru
e)
define(_COPYRIGHT_YEAR, 2019)
AC_INIT([Merge Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[www.projectmerge.org],[merge])
AC_CONFIG_SRCDIR([src/main.cpp])
...
...
src/kernel.cpp
View file @
14786fee
...
...
@@ -291,6 +291,11 @@ bool stakeTargetHit(uint256 hashProofOfStake, int64_t nValueIn, uint256 bnTarget
return
(
uint256
(
hashProofOfStake
)
<
bnCoinDayWeight
*
bnTargetPerCoinDay
);
}
void
DebugStakeHash
(
uint64_t
currentModifier
,
unsigned
int
nTimeBlockFrom
,
unsigned
int
prevoutn
,
uint256
prevouthash
,
unsigned
int
nTimeTx
)
{
LogPrintf
(
"modifier %016llx ntimeblockfrom %d prevoutn %d prevouthash %s ntimetx %d
\n
"
,
currentModifier
,
nTimeBlockFrom
,
prevoutn
,
prevouthash
.
ToString
().
c_str
(),
nTimeTx
);
}
//instead of looping outside and reinitializing variables many times, we will give a nTimeTx and also search interval so that we can do all the hashing here
bool
CheckStakeKernelHash
(
unsigned
int
nBits
,
const
CBlock
blockFrom
,
const
CTransaction
txPrev
,
const
COutPoint
prevout
,
unsigned
int
&
nTimeTx
,
unsigned
int
nHashDrift
,
bool
fCheck
,
uint256
&
hashProofOfStake
,
bool
fPrintProofOfStake
)
{
...
...
@@ -317,6 +322,11 @@ bool CheckStakeKernelHash(unsigned int nBits, const CBlock blockFrom, const CTra
return
false
;
}
if
(
fDebug
)
{
LogPrintf
(
"debug blockhash %s
\n
"
,
blockFrom
.
GetHash
().
ToString
().
c_str
());
DebugStakeHash
(
nStakeModifier
,
nTimeBlockFrom
,
prevout
.
n
,
prevout
.
hash
,
nTimeTx
);
}
//create data stream once instead of repeating it in the loop
CDataStream
ss
(
SER_GETHASH
,
0
);
ss
<<
nStakeModifier
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment