Skip to content

Buffer getter methods return internal references instead of copies #538

@aristidesstaffieri

Description

@aristidesstaffieri

What version are you using?

latest

Problem

File: internal/indexer/indexer_buffer.go (multiple methods)

Description: GetTrustlineChanges(), GetContractChanges(), GetAccountChanges(), GetSACBalanceChanges(), and GetStateChanges() return direct references to internal data structures. Compare with GetTransactionsParticipants() which correctly uses maps.Clone(). While currently safe because data is consumed synchronously before Clear(), this violates the buffer's thread-safety contract and is fragile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions