mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-12 17:16:43 +00:00

* [NOD-275] Moved getBlockTemplate and related functionality to a separate file. * [NOD-275] Started moving handlers to separate files. * [NOD-275] Fixed merge errors. * [NOD-275] Moved all handlers out of rpcserver.go. * [NOD-275] Moved non-shared functions out of rpcserver.go. * [NOD-275] Moved handleGetAllManualNodesInfo to a separate file. * [NOD-275] Moved handlers out of rpcwebsocket.go to separate files. * [NOD-275] Fixed import error. * [NOD-275] Renamed all handler files to include underscores. * [NOD-275] Moved common rpc helper functions to common.go.
24 lines
629 B
Go
24 lines
629 B
Go
package rpc
|
|
|
|
import "github.com/daglabs/btcd/btcjson"
|
|
|
|
// handleGetRawMempool implements the getRawMempool command.
|
|
func handleGetRawMempool(s *Server, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
|
|
c := cmd.(*btcjson.GetRawMempoolCmd)
|
|
mp := s.cfg.TxMemPool
|
|
|
|
if c.Verbose != nil && *c.Verbose {
|
|
return mp.RawMempoolVerbose(), nil
|
|
}
|
|
|
|
// The response is simply an array of the transaction hashes if the
|
|
// verbose flag is not set.
|
|
descs := mp.TxDescs()
|
|
hashStrings := make([]string, len(descs))
|
|
for i := range hashStrings {
|
|
hashStrings[i] = descs[i].Tx.ID().String()
|
|
}
|
|
|
|
return hashStrings, nil
|
|
}
|