forked from TrueCloudLab/neoneo-go
rpc: move getrawmempool RPC to a separate func
This commit is contained in:
parent
4e25c9121b
commit
dfb4171e3c
1 changed files with 10 additions and 6 deletions
|
@ -258,12 +258,7 @@ Methods:
|
|||
results = peers
|
||||
|
||||
case "getrawmempool":
|
||||
mp := s.chain.GetMemPool()
|
||||
hashList := make([]util.Uint256, 0)
|
||||
for _, item := range mp.GetVerifiedTransactions() {
|
||||
hashList = append(hashList, item.Tx.Hash())
|
||||
}
|
||||
results = hashList
|
||||
results, resultsErr = s.getRawMempool(reqParams)
|
||||
|
||||
case "getstorage":
|
||||
results, resultsErr = s.getStorage(reqParams)
|
||||
|
@ -322,6 +317,15 @@ Methods:
|
|||
s.WriteResponse(req, w, results)
|
||||
}
|
||||
|
||||
func (s *Server) getRawMempool(_ request.Params) (interface{}, error) {
|
||||
mp := s.chain.GetMemPool()
|
||||
hashList := make([]util.Uint256, 0)
|
||||
for _, item := range mp.GetVerifiedTransactions() {
|
||||
hashList = append(hashList, item.Tx.Hash())
|
||||
}
|
||||
return hashList, nil
|
||||
}
|
||||
|
||||
func (s *Server) validateAddress(reqParams request.Params) (interface{}, error) {
|
||||
param, ok := reqParams.Value(0)
|
||||
if !ok {
|
||||
|
|
Loading…
Reference in a new issue