Beispiel #1
0
func (tran *TransactionList) Print() {

	for _, tx := range tran.Txs {

		log.Printf("TxId: %v", tx.Hash)

		log.Print("TxIns:")
		if tx.TxInCnt == 1 && tx.TxIns[0].InputVout == 4294967295 {
			log.Printf("TxIn coinbase, newly generated coins")
		} else {
			for txin_index, txin := range tx.TxIns {
				log.Printf("TxIn index: %v", txin_index)
				log.Printf("TxIn Input_Hash: %v", txin.InputHash)
				log.Printf("TxIn Input_Index: %v", txin.InputVout)
			}
		}

		log.Print("TxOuts:")

		for txo_index, txout := range tx.TxOuts {
			log.Printf("TxOut index: %v", txo_index)
			log.Printf("TxOut value: %v", txout.Value)
			txout_addr := txout.Addr
			if txout_addr != "" {
				log.Printf("TxOut address: %v", txout_addr)
			} else {
				log.Printf("TxOut address: can't decode address")
			}
		}
	}

}
Beispiel #2
0
func sshLs(c *cli.Context) error {
	cfg := loadConfigOrFail(c)
	var devs []string
	if c.Bool("a") {
		devs = cfg.Config.GetSuffixColumn("ssh")
	} else {
		devs = []string{cfg.DeviceName}
	}
	for _, dev := range devs {
		for _, pub := range cfg.Config.GetSuffixColumn("ssh", dev) {
			log.Printf("SSH-key for device %s: %s", dev, pub)
		}
	}
	return nil
}