6 log "github.com/sirupsen/logrus"
8 "github.com/vapor/consensus"
9 "github.com/vapor/consensus/segwit"
10 "github.com/vapor/wallet"
13 func ProgToAddress(prog []byte, netParams *consensus.Params) string {
14 hash, err := segwit.GetHashFromStandardProg(prog)
16 log.WithFields(log.Fields{"prog": hex.EncodeToString(prog), "err": err}).Warn("fail on GetHashFromStandardProg")
20 if segwit.IsP2WPKHScript(prog) {
21 return wallet.BuildP2PKHAddress(hash, netParams)
22 } else if segwit.IsP2WSHScript(prog) {
23 return wallet.BuildP2SHAddress(hash, netParams)