Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
e1cfbf6f
Commit
e1cfbf6f
authored
Sep 30, 2021
by
mdj33
Committed by
33cn
Oct 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust tx hash calc sequence
parent
acb8402d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
parasync.go
plugin/consensus/para/parasync.go
+6
-6
No files found.
plugin/consensus/para/parasync.go
View file @
e1cfbf6f
...
...
@@ -427,18 +427,18 @@ func (client *blockSyncClient) addBlock(lastBlock *types.Block, localBlock *pt.P
}
//挖矿固定难度
newBlock
.
Difficulty
=
cfg
.
GetP
(
0
)
.
PowLimitBits
//需要首先对交易进行排序然后再计算TxHash
if
cfg
.
IsFork
(
newBlock
.
GetMainHeight
(),
"ForkRootHash"
)
{
newBlock
.
Txs
=
types
.
TransactionSort
(
newBlock
.
Txs
)
}
newBlock
.
TxHash
=
merkle
.
CalcMerkleRoot
(
cfg
,
newBlock
.
GetMainHeight
(),
newBlock
.
Txs
)
newBlock
.
BlockTime
=
localBlock
.
BlockTime
newBlock
.
MainHash
=
localBlock
.
MainHash
newBlock
.
MainHeight
=
localBlock
.
MainHeight
if
newBlock
.
Height
==
1
&&
newBlock
.
BlockTime
<
client
.
paraClient
.
cfg
.
GenesisBlockTime
{
panic
(
"genesisBlockTime bigger than the 1st block time, need rmv db and reset genesisBlockTime"
)
}
//需要首先对交易进行排序然后再计算TxHash
if
cfg
.
IsFork
(
newBlock
.
GetMainHeight
(),
"ForkRootHash"
)
{
newBlock
.
Txs
=
types
.
TransactionSort
(
newBlock
.
Txs
)
}
newBlock
.
TxHash
=
merkle
.
CalcMerkleRoot
(
cfg
,
newBlock
.
GetMainHeight
(),
newBlock
.
Txs
)
err
=
client
.
writeBlock
(
lastBlock
.
StateHash
,
&
newBlock
)
client
.
printDebugInfo
(
"Para sync - create new Block"
,
...
...
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