You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
379 B
20 lines
379 B
package core |
|
|
|
import ( |
|
"time" |
|
) |
|
|
|
// Block Struct |
|
type Block struct { |
|
Timestamp time.Time |
|
Hash string |
|
PreviousHash string |
|
Data []Transaction |
|
Nonce int |
|
} |
|
|
|
// AddTransaction takes in a transaction and adds it to the block |
|
func (block *Block) AddTransaction(transaction Transaction) error { |
|
block.Data = append(block.Data, transaction) |
|
return nil |
|
}
|
|
|