func getValidEntries() ([]*factom.Entry, error) {
	es, err := factom.GetAllChainEntries(chainid)
	if err != nil {
		return nil, err
	}

	validEntries := make([]*factom.Entry, 0)
	for _, e := range es {
		if poloniexIsValid(e) {
			validEntries = append(validEntries, e)
		}
	}

	return validEntries, nil
}
Exemple #2
0
		flag.Parse()
		args = flag.Args()

		var chainid string

		if len(args) < 1 && len(nameCollector) == 0 {
			fmt.Println(cmd.helpMsg)
			return
		}
		if len(nameCollector) != 0 {
			chainid = nametoid(nameCollector)
		} else {
			chainid = args[0]
		}

		es, err := factom.GetAllChainEntries(chainid)
		if err != nil {
			for i, e := range es {
				fmt.Printf("Entry [%d] {\n%s}\n", i, e)
			}
			errorln(err)
			return
		}

		for i, e := range es {
			fmt.Printf("Entry [%d] {\n%s}\n", i, e)
		}
	}
	help.Add("get allentries", cmd)
	return cmd
}()