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
f49f95e2
Commit
f49f95e2
authored
Feb 20, 2019
by
Dan Kinsley
Committed by
Guillaume Ballet
Feb 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounts/abi: mutex lock in TransactionByHash and code cleanup (#19133)
parent
d3ccedc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
4 deletions
+36
-4
simulated.go
accounts/abi/bind/backends/simulated.go
+4
-4
simulated_test.go
accounts/abi/bind/backends/simulated_test.go
+16
-0
base_test.go
accounts/abi/bind/base_test.go
+16
-0
No files found.
accounts/abi/bind/backends/simulated.go
View file @
f49f95e2
...
...
@@ -168,18 +168,18 @@ func (b *SimulatedBackend) TransactionReceipt(ctx context.Context, txHash common
// blockchain. The isPending return value indicates whether the transaction has been
// mined yet. Note that the transaction may not be part of the canonical chain even if
// it's not pending.
func
(
b
*
SimulatedBackend
)
TransactionByHash
(
ctx
context
.
Context
,
txHash
common
.
Hash
)
(
tx
*
types
.
Transaction
,
isPending
bool
,
err
error
)
{
func
(
b
*
SimulatedBackend
)
TransactionByHash
(
ctx
context
.
Context
,
txHash
common
.
Hash
)
(
*
types
.
Transaction
,
bool
,
error
)
{
b
.
mu
.
Lock
()
defer
b
.
mu
.
Unlock
()
tx
=
b
.
pendingBlock
.
Transaction
(
txHash
)
tx
:
=
b
.
pendingBlock
.
Transaction
(
txHash
)
if
tx
!=
nil
{
return
tx
,
true
,
nil
}
tx
,
_
,
_
,
_
=
rawdb
.
ReadTransaction
(
b
.
database
,
txHash
)
if
tx
!=
nil
{
return
tx
,
false
,
nil
}
return
nil
,
false
,
ethereum
.
NotFound
}
...
...
accounts/abi/bind/backends/simulated_test.go
View file @
f49f95e2
// Copyright 2019 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package
backends_test
import
(
...
...
accounts/abi/bind/base_test.go
View file @
f49f95e2
// Copyright 2019 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package
bind_test
import
(
...
...
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