aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/txpool.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-30 20:18:51 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-30 20:18:51 +0800
commit130f3b270a9b2f7bd680188c67013695d5f9412b (patch)
tree92345071d9db2a938e64eef4eb929e0f895e337a /rpc/api/txpool.go
parent9226369b5daf8c1bf738369cd838963a5d58362d (diff)
parent61ca780f3ba21ef1e62aab545160de12cbbf45bf (diff)
downloadgo-tangerine-130f3b270a9b2f7bd680188c67013695d5f9412b.tar
go-tangerine-130f3b270a9b2f7bd680188c67013695d5f9412b.tar.gz
go-tangerine-130f3b270a9b2f7bd680188c67013695d5f9412b.tar.bz2
go-tangerine-130f3b270a9b2f7bd680188c67013695d5f9412b.tar.lz
go-tangerine-130f3b270a9b2f7bd680188c67013695d5f9412b.tar.xz
go-tangerine-130f3b270a9b2f7bd680188c67013695d5f9412b.tar.zst
go-tangerine-130f3b270a9b2f7bd680188c67013695d5f9412b.zip
Merge pull request #1362 from obscuren/txpool-cleanup
core: reduce CPU load by reducing calls to checkQueue
Diffstat (limited to 'rpc/api/txpool.go')
-rw-r--r--rpc/api/txpool.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/rpc/api/txpool.go b/rpc/api/txpool.go
index 25ad6e9b2..04faf463c 100644
--- a/rpc/api/txpool.go
+++ b/rpc/api/txpool.go
@@ -68,8 +68,9 @@ func (self *txPoolApi) ApiVersion() string {
}
func (self *txPoolApi) Status(req *shared.Request) (interface{}, error) {
+ pending, queue := self.ethereum.TxPool().Stats()
return map[string]int{
- "pending": self.ethereum.TxPool().GetTransactions().Len(),
- "queued": self.ethereum.TxPool().GetQueuedTransactions().Len(),
+ "pending": pending,
+ "queued": queue,
}, nil
}