OSDN Git Service

Added blockchain struct.
[bytom/bytom.git] / protocol / bc / mux.go
1 package bc
2
3 import "io"
4
5 // Mux splits and combines value from one or more source entries,
6 // making it available to one or more destination entries. It
7 // satisfies the Entry interface.
8
9 func (Mux) typ() string { return "mux1" }
10 func (m *Mux) writeForHash(w io.Writer) {
11         mustWriteForHash(w, m.Sources)
12         mustWriteForHash(w, m.Program)
13         mustWriteForHash(w, m.ExtHash)
14 }
15
16 // NewMux creates a new Mux.
17 func NewMux(sources []*ValueSource, program *Program) *Mux {
18         return &Mux{
19                 Sources: sources,
20                 Program: program,
21         }
22 }