Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
4b6f6ffe
Unverified
Commit
4b6f6ffe
authored
Apr 29, 2020
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state/snapshot: fix journal nil deserialziation
parent
26d271df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
journal.go
core/state/snapshot/journal.go
+10
-2
No files found.
core/state/snapshot/journal.go
View file @
4b6f6ffe
...
...
@@ -158,7 +158,11 @@ func loadDiffLayer(parent snapshot, r *rlp.Stream) (snapshot, error) {
}
accountData
:=
make
(
map
[
common
.
Hash
][]
byte
)
for
_
,
entry
:=
range
accounts
{
if
len
(
entry
.
Blob
)
>
0
{
// RLP loses nil-ness, but `[]byte{}` is not a valid item, so reinterpret that
accountData
[
entry
.
Hash
]
=
entry
.
Blob
}
else
{
accountData
[
entry
.
Hash
]
=
nil
}
}
var
storage
[]
journalStorage
if
err
:=
r
.
Decode
(
&
storage
);
err
!=
nil
{
...
...
@@ -168,7 +172,11 @@ func loadDiffLayer(parent snapshot, r *rlp.Stream) (snapshot, error) {
for
_
,
entry
:=
range
storage
{
slots
:=
make
(
map
[
common
.
Hash
][]
byte
)
for
i
,
key
:=
range
entry
.
Keys
{
if
len
(
entry
.
Vals
[
i
])
>
0
{
// RLP loses nil-ness, but `[]byte{}` is not a valid item, so reinterpret that
slots
[
key
]
=
entry
.
Vals
[
i
]
}
else
{
slots
[
key
]
=
nil
}
}
storageData
[
entry
.
Hash
]
=
slots
}
...
...
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