package models

type RaspOpen struct {
	//Model
	Hash   string `json:"hash" gorm:"PRIMARY_KEY"`
	Miner  string `json:"miner"`
	ReturnAddr string `json:"return_addr"`
}


// GetHeight get lastheight in chain33
func GetReturnAddr(hash string) (string, error) {
	var open RaspOpen
	err := db.Model(&RaspOpen{}).Where("hash = ?",hash).First(&open).Error
	if err != nil  {
		return "",err
	}
	return open.ReturnAddr, nil
}


