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
0e7d019e
Unverified
Commit
0e7d019e
authored
Oct 20, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fire tx event on replace, expand tests
parent
eaa4f8a5
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
191 additions
and
4 deletions
+191
-4
matcher_test.go
core/bloombits/matcher_test.go
+1
-1
tx_pool.go
core/tx_pool.go
+5
-0
tx_pool_test.go
core/tx_pool_test.go
+185
-3
No files found.
core/bloombits/matcher_test.go
View file @
0e7d019e
...
...
@@ -85,7 +85,7 @@ func TestWildcardMatcher(t *testing.T) {
}
// makeRandomIndexes generates a random filter system, composed on multiple filter
// criteria, each having one bloom list component for the address and arbitraril
l
y
// criteria, each having one bloom list component for the address and arbitrarily
// many topic bloom list components.
func
makeRandomIndexes
(
lengths
[]
int
,
max
int
)
[][]
bloomIndexes
{
res
:=
make
([][]
bloomIndexes
,
len
(
lengths
))
...
...
core/tx_pool.go
View file @
0e7d019e
...
...
@@ -640,6 +640,10 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (bool, error) {
pool
.
journalTx
(
from
,
tx
)
log
.
Trace
(
"Pooled new executable transaction"
,
"hash"
,
hash
,
"from"
,
from
,
"to"
,
tx
.
To
())
// We've directly injected a replacement transaction, notify subsystems
go
pool
.
txFeed
.
Send
(
TxPreEvent
{
tx
})
return
old
!=
nil
,
nil
}
// New transaction isn't replacing a pending one, push into queue
...
...
@@ -729,6 +733,7 @@ func (pool *TxPool) promoteTx(addr common.Address, hash common.Hash, tx *types.T
// Set the potentially new pending nonce and notify any subsystems of the new tx
pool
.
beats
[
addr
]
=
time
.
Now
()
pool
.
pendingState
.
SetNonce
(
addr
,
tx
.
Nonce
()
+
1
)
go
pool
.
txFeed
.
Send
(
TxPreEvent
{
tx
})
}
...
...
core/tx_pool_test.go
View file @
0e7d019e
This diff is collapsed.
Click to expand it.
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