diff --git a/docs/json_rpc_api.mediawiki b/docs/json_rpc_api.mediawiki index b397e008..9e73a511 100644 --- a/docs/json_rpc_api.mediawiki +++ b/docs/json_rpc_api.mediawiki @@ -1463,7 +1463,9 @@ of the best block. : difficulty: (numeric) the current target difficulty. : testnet: (boolean) whether or not server is using testnet. : relayfee: (numeric) the minimum relay fee for non-free transactions in DCR/KB. -{"version": n,"protocolversion": n, "blocks": n, "timeoffset": n, "connections": n, "proxy": "host:port", "difficulty": n.nn, "testnet": true or false, "relayfee": n.nn} +: addrindex: (boolean) whether or not server has address index enabled. +: txindex: (boolean) whether or not server has transaction index enabled. +{"version": n,"protocolversion": n, "blocks": n, "timeoffset": n, "connections": n, "proxy": "host:port", "difficulty": n.nn, "testnet": true or false, "relayfee": n.nn, "addrindex": true or false, "txindex": true or false} |- !Example Return |{"version": 70000, "protocolversion": 70001, "blocks": 298963, "timeoffset": 0, "connections": 17, "proxy": "", "difficulty": 8000872135.97, "testnet": false,"relayfee": 0.00001} diff --git a/rpc/jsonrpc/types/chainsvrresults.go b/rpc/jsonrpc/types/chainsvrresults.go index 67e0202c..57b5f701 100644 --- a/rpc/jsonrpc/types/chainsvrresults.go +++ b/rpc/jsonrpc/types/chainsvrresults.go @@ -193,6 +193,8 @@ type InfoChainResult struct { TestNet bool `json:"testnet"` RelayFee float64 `json:"relayfee"` Errors string `json:"errors"` + AddrIndex bool `json:"addrindex"` + TxIndex bool `json:"txindex"` } // GetMempoolInfoResult models the data returned from the getmempoolinfo diff --git a/rpcserver.go b/rpcserver.go index 11e47466..eb256a5e 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -2345,6 +2345,8 @@ func handleGetInfo(_ context.Context, s *rpcServer, cmd interface{}) (interface{ Difficulty: getDifficultyRatio(best.Bits, s.cfg.ChainParams), TestNet: cfg.TestNet, RelayFee: cfg.minRelayTxFee.ToCoin(), + AddrIndex: cfg.AddrIndex, + TxIndex: cfg.TxIndex, } return ret, nil diff --git a/rpcserverhelp.go b/rpcserverhelp.go index 6190bc03..1ea934d9 100644 --- a/rpcserverhelp.go +++ b/rpcserverhelp.go @@ -503,6 +503,8 @@ var helpDescsEnUS = map[string]string{ "infochainresult-testnet": "Whether or not server is using testnet", "infochainresult-relayfee": "The minimum relay fee for non-free transactions in DCR/KB", "infochainresult-errors": "Any current errors", + "infochainresult-addrindex": "Whether or not server has address index enabled", + "infochainresult-txindex": "Whether or not server has transaction index enabled", // InfoWalletResult help. "infowalletresult-version": "The version of the server",