code: func createVoutList(mtx *wire.MsgTx, chainParams *chaincfg.Params, filterAddrMap map[string]struct{}) []btcjson.Vout {
  	voutList := make([]btcjson.Vout, 0, len(mtx.TxOut))
  	for i, v := range mtx.TxOut {
  		// The disassembled string will contain [error] inline if the
  		// script doesn't fully parse, so ignore the error here.
  		disbuf, _ := txscript.DisasmString(v.PkScript)
  
  		// Ignore the error here since an error means the script
  		// couldn't parse and there is no additional information about
  		// it anyways.
  		scriptClass, addrs, reqSigs, _ := txscript.ExtractPkScriptAddrs(
  			v.PkScript, chainParams)
  
  		// Encode the addresses while checking if the address passes the
  		// filter when needed.
  		passesFilter := len(filterAddrMap) == 0
  		encodedAddrs := make([]string, len(addrs))
  		for j, addr := range addrs {
  			encodedAddr := addr.EncodeAddress()
  			encodedAddrs[j] = encodedAddr
  
  			// No need to check the map again if the filter already
  			// passes.
  			if passesFilter {
  				continue
  			}
  			if _, exists := filterAddrMap[encodedAddr]; exists {
  				passesFilter = true
  			}
  		}
  
  		if !passesFilter {
  			continue
  		}
  
  		var vout btcjson.Vout
  		vout.N = uint32(i)
  		vout.Value = btcutil.Amount(v.Value).ToBTC()
  		vout.ScriptPubKey.Addresses = encodedAddrs
  		vout.ScriptPubKey.Asm = disbuf
  		vout.ScriptPubKey.Hex = hex.EncodeToString(v.PkScript)
  		vout.ScriptPubKey.Type = scriptClass.String()
  		vout.ScriptPubKey.ReqSigs = int32(reqSigs)
  
  		voutList = append(voutList, vout)
  	}
  
  	return voutList
  }
docs: // createVoutList returns a slice of JSON objects for the outputs of the passed
  // transaction.