MCPcopy Create free account
hub / github.com/copernet/copernicus / Decode

Method Decode

model/script/script.go:235–246  ·  view source on GitHub ↗
(reader io.Reader, isCoinBase bool)

Source from the content-addressed store, hash-verified

233}
234
235func (s *Script) Decode(reader io.Reader, isCoinBase bool) (err error) {
236 bytes, err := ReadScript(reader, MaxMessagePayload, "tx input signature script")
237 if err != nil {
238 return err
239 }
240 s.data = bytes
241 if isCoinBase {
242 return nil
243 }
244 err = s.convertOPS()
245 return err
246}
247
248func (s *Script) IsSpendable() bool {
249 if (len(s.data) > 0 && s.data[0] == opcodes.OP_RETURN) || len(s.data) > MaxScriptSize {

Callers 1

UnserializeMethod · 0.95

Calls 2

convertOPSMethod · 0.95
ReadScriptFunction · 0.85

Tested by

no test coverage detected