OSDN Git Service

Merge pull request #41 from Bytom/dev
[bytom/vapor.git] / database / storage / utxo_entry.go
1 package storage
2
3 // NewUtxoEntry will create a new utxo entry
4 func NewUtxoEntry(isCoinBase bool, blockHeight uint64, spent bool) *UtxoEntry {
5         return &UtxoEntry{
6                 IsCoinBase:  isCoinBase,
7                 BlockHeight: blockHeight,
8                 Spent:       spent,
9         }
10 }
11
12 // SpendOutput marks the output at the provided index as spent
13 func (entry *UtxoEntry) SpendOutput() {
14         entry.Spent = true
15 }
16
17 // UnspendOutput marks the output at the provided index as unspent
18 func (entry *UtxoEntry) UnspendOutput() {
19         entry.Spent = false
20 }