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
df3366d9
Commit
df3366d9
authored
Dec 18, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rlp shouldn't write null bytes
parent
4dbdcaec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
rlp.go
ethutil/rlp.go
+7
-3
No files found.
ethutil/rlp.go
View file @
df3366d9
...
...
@@ -2,7 +2,6 @@ package ethutil
import
(
"bytes"
"encoding/binary"
"fmt"
"math/big"
"reflect"
...
...
@@ -193,8 +192,13 @@ func Encode(object interface{}) []byte {
if
blen
<
56
{
buff
.
WriteByte
(
byte
(
blen
)
+
0xc0
)
}
else
{
buff
.
WriteByte
(
byte
(
intlen
(
int64
(
blen
)))
+
0xf7
)
binary
.
Write
(
&
buff
,
binary
.
BigEndian
,
int64
(
blen
))
ilen
:=
byte
(
intlen
(
int64
(
blen
)))
buff
.
WriteByte
(
ilen
+
0xf7
)
t
:=
make
([]
byte
,
ilen
)
for
i
:=
byte
(
0
);
i
<
ilen
;
i
++
{
t
[
ilen
-
i
-
1
]
=
byte
(
blen
>>
(
i
*
8
))
}
buff
.
Write
(
t
)
}
buff
.
ReadFrom
(
&
b
)
}
...
...
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