Skip to content

Bug: SDK overwrites application log level and example scripts fail from race conditions #106

@Dunsin-cyber

Description

@Dunsin-cyber

1. Global Logger Mutation

The Problem: Calling Unlock() in base_client.go explicitly sets the global logrus level to DebugLevel or ErrorLevel.
The Impact: The SDK forcefully overwrites the logging configuration of any parent application importing it. Libraries should not mutate global state.

2. Race Conditions in Examples

The Problem: Example scripts (like alice_to_bob.go) do not wait for the background wallet sync to finish after calling Unlock().
The Impact: The scripts race ahead and try to spend funds before the internal database is populated.

How to Reproduce:

For this to work, #105 should have been merged to solve the panic bug. Once that is done, you can proceed with:

  1. Run example/alice_to_bob/alice_to_bob.go
  2. Logs after the Unlock() for alice won't show
  3. It exits with error "wallet is still syncing"
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions