func (to *TxOut) SetScript(script []byte) { to.PkScript = script to.PkScriptLength = mymath.VarInt(len(to.PkScript)) }
func (to *TxOut) SetScriptStr(script string, opcode byte) { to.PkScript = mymath.AddByte(mymath.String2Hex(script), opcode) to.PkScriptLength = mymath.VarInt(len(to.PkScript)) }
func (ti *TxIn) SetSignature(sig []byte) { ti.SignatureScript = sig ti.ScriptLength = mymath.VarInt(len(ti.SignatureScript)) }