21 lines
290 B
Go
21 lines
290 B
Go
package blockchain
|
|
|
|
type TxOutput struct {
|
|
Value int
|
|
PubKey string
|
|
}
|
|
|
|
type TxInput struct {
|
|
ID []byte
|
|
Out int
|
|
Sig string
|
|
}
|
|
|
|
func (in *TxInput) CanUnlock(data string) bool {
|
|
return in.Sig == data
|
|
}
|
|
|
|
func (out *TxOutput) CanBeUnlocked(data string) bool {
|
|
return out.PubKey == data
|
|
}
|