forked from TrueCloudLab/neoneo-go
parent
9adb3a0b37
commit
990db9f205
2 changed files with 19 additions and 2 deletions
10
pkg/rpc/response/result/raw_mempool.go
Normal file
10
pkg/rpc/response/result/raw_mempool.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package result
|
||||
|
||||
import "github.com/nspcc-dev/neo-go/pkg/util"
|
||||
|
||||
// RawMempool represents a result of getrawmempool RPC call.
|
||||
type RawMempool struct {
|
||||
Height uint32 `json:"height"`
|
||||
Verified []util.Uint256 `json:"verified"`
|
||||
Unverified []util.Uint256 `json:"unverified"`
|
||||
}
|
|
@ -463,13 +463,20 @@ func (s *Server) getPeers(_ request.Params) (interface{}, *response.Error) {
|
|||
return peers, nil
|
||||
}
|
||||
|
||||
func (s *Server) getRawMempool(_ request.Params) (interface{}, *response.Error) {
|
||||
func (s *Server) getRawMempool(reqParams request.Params) (interface{}, *response.Error) {
|
||||
verbose := reqParams.Value(0).GetBoolean()
|
||||
mp := s.chain.GetMemPool()
|
||||
hashList := make([]util.Uint256, 0)
|
||||
for _, item := range mp.GetVerifiedTransactions() {
|
||||
hashList = append(hashList, item.Hash())
|
||||
}
|
||||
if !verbose {
|
||||
return hashList, nil
|
||||
}
|
||||
return result.RawMempool{
|
||||
Height: s.chain.BlockHeight(),
|
||||
Verified: hashList,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) validateAddress(reqParams request.Params) (interface{}, *response.Error) {
|
||||
|
|
Loading…
Reference in a new issue