OSDN Git Service

try to fix ban peer bug (#273)
[bytom/vapor.git] / protocol / bc / intrachain_output.go
1 package bc
2
3 import "io"
4
5 // IntraChainOutput is the result of a transfer of value. The value it contains
6 // may be accessed by a later Spend entry (if that entry can satisfy
7 // the Output's ControlProgram). IntraChainOutput satisfies the Entry interface.
8 //
9 // (Not to be confused with the deprecated type TxOutput.)
10
11 func (IntraChainOutput) typ() string { return "intrachainoutput1" }
12 func (o *IntraChainOutput) writeForHash(w io.Writer) {
13         mustWriteForHash(w, o.Source)
14         mustWriteForHash(w, o.ControlProgram)
15 }
16
17 // NewIntraChainOutput creates a new IntraChainOutput.
18 func NewIntraChainOutput(source *ValueSource, controlProgram *Program, ordinal uint64) *IntraChainOutput {
19         return &IntraChainOutput{
20                 Source:         source,
21                 ControlProgram: controlProgram,
22                 Ordinal:        ordinal,
23         }
24 }