diff options
Diffstat (limited to 'rpc/api/txpool.go')
-rw-r--r-- | rpc/api/txpool.go | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/rpc/api/txpool.go b/rpc/api/txpool.go index 25ad6e9b2..14934ae13 100644 --- a/rpc/api/txpool.go +++ b/rpc/api/txpool.go @@ -1,3 +1,19 @@ +// Copyright 2015 The go-ethereum Authors +// This file is part of go-ethereum. +// +// go-ethereum 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. +// +// go-ethereum 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 go-ethereum. If not, see <http://www.gnu.org/licenses/>. + package api import ( @@ -68,8 +84,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 } |