Skip to content

Commit

Permalink
[release-v1.6] multi: Add TAdd support to getrawmempool.
Browse files Browse the repository at this point in the history
This adds support to querying specifically for tadds when using the
getrawmempool rpc call.

It also adds the missing tspend to the help command when using an
invalid txtype argument to getrawmempool.
  • Loading branch information
matheusd authored and davecgh committed Oct 27, 2020
1 parent 851ffca commit f4c318e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/rpcserver/rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2714,12 +2714,15 @@ func handleGetRawMempool(_ context.Context, s *Server, cmd interface{}) (interfa
case types.GRMTSpend:
filterType = new(stake.TxType)
*filterType = stake.TxTypeTSpend
case types.GRMTAdd:
filterType = new(stake.TxType)
*filterType = stake.TxTypeTAdd
case types.GRMAll:
// Nothing to do
default:
supported := []types.GetRawMempoolTxTypeCmd{types.GRMRegular,
types.GRMTickets, types.GRMVotes, types.GRMRevocations,
types.GRMAll}
types.GRMTSpend, types.GRMTAdd, types.GRMAll}
return nil, rpcInvalidError("Invalid transaction type: %s -- "+
"supported types: %v", *c.TxType, supported)
}
Expand Down
3 changes: 3 additions & 0 deletions rpc/jsonrpc/types/chainsvrcmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ const (

// GRMTSpend indicates that only tspends should be returned.
GRMTSpend GetRawMempoolTxTypeCmd = "tspend"

// GRMTAdd indicates that only tadds should be returned.
GRMTAdd GetRawMempoolTxTypeCmd = "tadd"
)

// GetRawMempoolCmd defines the getmempool JSON-RPC command.
Expand Down

0 comments on commit f4c318e

Please sign in to comment.