code: func (view *UtxoViewpoint) commit() {
  	for outpoint, entry := range view.entries {
  		if entry == nil || (entry.isModified() && entry.IsSpent()) {
  			delete(view.entries, outpoint)
  			continue
  		}
  
  		entry.packedFlags ^= tfModified
  	}
  }
docs: // commit prunes all entries marked modified that are now fully spent and marks
  // all entries as unmodified.