コード例 #1
0
ファイル: transaction.go プロジェクト: johncap46/fctwallet
func HandleProperties(ctx *web.Context) {
	prop, err := Wallet.GetProperties()
	if err != nil {
		reportResults(ctx, "Failed to retrieve properties", false)
		return
	}

	top := prop.Protocol_Version / 1000000
	mid := (prop.Protocol_Version % 1000000) / 1000
	low := prop.Protocol_Version % 1000

	ret := fmt.Sprintf("Protocol Version:   %d.%d.%d\n", top, mid, low)

	top = prop.Factomd_Version / 1000000
	mid = (prop.Factomd_Version % 1000000) / 1000
	low = prop.Factomd_Version % 1000

	ret = ret + fmt.Sprintf("factomd Version:    %d.%d.%d\n", top, mid, low)

	top = prop.Fctwallet_Version / 1000000
	mid = (prop.Fctwallet_Version % 1000000) / 1000
	low = prop.Fctwallet_Version % 1000

	ret = ret + fmt.Sprintf("fctwallet Version:  %d.%d.%d\n", top, mid, low)

	reportResults(ctx, ret, true)

}
コード例 #2
0
func HandleProperties(ctx *web.Context) {
	p, f, w, err := Wallet.GetProperties()
	if err != nil {
		reportResults(ctx, "Failed to retrieve properties", false)
		return
	}

	ret := fmt.Sprintf("Protocol Version:   %s\n", p)
	ret = ret + fmt.Sprintf("factomd Version:    %s\n", f)
	ret = ret + fmt.Sprintf("fctwallet Version:  %s\n", w)

	reportResults(ctx, ret, true)

}