github.com/Bytom/bytom@v1.1.2-0.20210127130405-ae40204c0b09/database/storage/utxo_entry.go (about) 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 }