Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
exchain
nebula
Commits
ccc01893
Commit
ccc01893
authored
Jan 26, 2023
by
Sebastian Stammler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-batcher: Fix channelManager.Clean - set tip to zero
parent
502732d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
channel_manager.go
op-batcher/batcher/channel_manager.go
+2
-3
No files found.
op-batcher/batcher/channel_manager.go
View file @
ccc01893
...
...
@@ -78,6 +78,7 @@ func NewChannelManager(log log.Logger, cfg ChannelConfig) *channelManager {
func
(
s
*
channelManager
)
Clear
()
{
s
.
log
.
Trace
(
"clearing channel manager state"
)
s
.
blocks
=
s
.
blocks
[
:
0
]
s
.
tip
=
common
.
Hash
{}
s
.
clearPendingChannel
()
}
...
...
@@ -269,13 +270,11 @@ func (s *channelManager) addBlocks() error {
return
nil
}
var
zeroHash
common
.
Hash
// AddL2Block saves an L2 block to the internal state. It returns ErrReorg
// if the block does not extend the last block loaded into the state.
// If no blocks were added yet, the parent hash check is skipped.
func
(
s
*
channelManager
)
AddL2Block
(
block
*
types
.
Block
)
error
{
if
s
.
tip
!=
zeroHash
&&
s
.
tip
!=
block
.
ParentHash
()
{
if
s
.
tip
!=
(
common
.
Hash
{})
&&
s
.
tip
!=
block
.
ParentHash
()
{
return
ErrReorg
}
s
.
blocks
=
append
(
s
.
blocks
,
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