Add chainname and activation height to getinfo

This commit is contained in:
Aditya Kulkarni
2019-09-18 21:16:15 -07:00
parent 7bf4a8407b
commit 3b4573c4f0
5 changed files with 122 additions and 84 deletions

View File

@@ -18,6 +18,7 @@ import (
// blank import for sqlite driver support
_ "github.com/mattn/go-sqlite3"
"github.com/adityapk00/lightwalletd/common"
"github.com/adityapk00/lightwalletd/storage"
"github.com/adityapk00/lightwalletd/walletrpc"
)
@@ -244,12 +245,16 @@ func (s *SqlStreamer) GetTransaction(ctx context.Context, txf *walletrpc.TxFilte
// GetLightdInfo gets the LightWalletD (this server) info
func (s *SqlStreamer) GetLightdInfo(ctx context.Context, in *walletrpc.Empty) (*walletrpc.LightdInfo, error) {
saplingHeight, chainName, _ := common.GetSaplingInfo(s.client)
// TODO these are called Error but they aren't at the moment.
// A success will return code 0 and message txhash.
return &walletrpc.LightdInfo{
Version: "0.1-zeclightd",
Vendor: "ZecWallet LightWalletD",
TaddrSupport: true,
Version: "0.1-zeclightd",
Vendor: "ZecWallet LightWalletD",
TaddrSupport: true,
ChainName: chainName,
SaplingActivationHeight: uint64(saplingHeight),
}, nil
}