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
23bca0f3
Commit
23bca0f3
authored
Jan 26, 2018
by
Felföldi Zsolt
Committed by
Péter Szilágyi
Jan 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
les: fix TxStatusMsg RLP coding (#15974)
parent
367c329b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
handler.go
les/handler.go
+2
-2
handler_test.go
les/handler_test.go
+1
-1
protocol.go
les/protocol.go
+2
-2
No files found.
les/handler.go
View file @
23bca0f3
...
...
@@ -1014,7 +1014,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
for
i
,
stat
:=
range
stats
{
if
stat
.
Status
==
core
.
TxStatusUnknown
{
if
errs
:=
pm
.
txpool
.
AddRemotes
([]
*
types
.
Transaction
{
req
.
Txs
[
i
]});
errs
[
0
]
!=
nil
{
stats
[
i
]
.
Error
=
errs
[
0
]
stats
[
i
]
.
Error
=
errs
[
0
]
.
Error
()
continue
}
stats
[
i
]
=
pm
.
txStatus
([]
common
.
Hash
{
hashes
[
i
]})[
0
]
...
...
@@ -1055,7 +1055,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
p
.
Log
()
.
Trace
(
"Received tx status response"
)
var
resp
struct
{
ReqID
,
BV
uint64
Status
[]
core
.
T
xStatus
Status
[]
t
xStatus
}
if
err
:=
msg
.
Decode
(
&
resp
);
err
!=
nil
{
return
errResp
(
ErrDecode
,
"msg %v: %v"
,
msg
,
err
)
...
...
les/handler_test.go
View file @
23bca0f3
...
...
@@ -444,7 +444,7 @@ func TestTransactionStatusLes2(t *testing.T) {
// test error status by sending an underpriced transaction
tx0
,
_
:=
types
.
SignTx
(
types
.
NewTransaction
(
0
,
acc1Addr
,
big
.
NewInt
(
10000
),
params
.
TxGas
,
nil
,
nil
),
signer
,
testBankKey
)
test
(
tx0
,
true
,
txStatus
{
Status
:
core
.
TxStatusUnknown
,
Error
:
core
.
ErrUnderpriced
})
test
(
tx0
,
true
,
txStatus
{
Status
:
core
.
TxStatusUnknown
,
Error
:
core
.
ErrUnderpriced
.
Error
()
})
tx1
,
_
:=
types
.
SignTx
(
types
.
NewTransaction
(
0
,
acc1Addr
,
big
.
NewInt
(
10000
),
params
.
TxGas
,
big
.
NewInt
(
100000000000
),
nil
),
signer
,
testBankKey
)
test
(
tx1
,
false
,
txStatus
{
Status
:
core
.
TxStatusUnknown
})
// query before sending, should be unknown
...
...
les/protocol.go
View file @
23bca0f3
...
...
@@ -224,6 +224,6 @@ type proofsData [][]rlp.RawValue
type
txStatus
struct
{
Status
core
.
TxStatus
Lookup
*
core
.
TxLookupEntry
Error
error
Lookup
*
core
.
TxLookupEntry
`rlp:"nil"`
Error
string
}
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