Skip to content

Commit

Permalink
BUG:the problem with value referencing about 'for range'
Browse files Browse the repository at this point in the history
  • Loading branch information
lochjin authored and dindinw committed Sep 26, 2023
1 parent 0d47814 commit fd2aaff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/blockchain/utxo.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,13 @@ func (b *BlockChain) FetchUtxoEntry(outpoint types.TxOutPoint) (*utxo.UtxoEntry,
}

func (b *BlockChain) dbPutUtxoView(view *utxo.UtxoViewpoint) error {
for outpoint, entry := range view.Entries() {
for op, en := range view.Entries() {
outpoint := op
entry := en
// No need to update the database if the entry was not modified.
if entry == nil || !entry.IsModified() {
continue
}

// Remove the utxo entry if it is spent.
if entry.IsSpent() {
key := utxo.OutpointKey(outpoint)
Expand Down

0 comments on commit fd2aaff

Please sign in to comment.