Skip to content

fix(walletapi): guard TokenAdd against nil EntriesNative map#44

Open
DHEBP wants to merge 1 commit into
DEROFDN:community-devfrom
DHEBP:fix/nil-entriesnative-guard
Open

fix(walletapi): guard TokenAdd against nil EntriesNative map#44
DHEBP wants to merge 1 commit into
DEROFDN:community-devfrom
DHEBP:fix/nil-entriesnative-guard

Conversation

@DHEBP

@DHEBP DHEBP commented Jul 14, 2026

Copy link
Copy Markdown

EntriesNative is populated lazily during sync; TokenAdd assigns into it unconditionally. A wallet opened before that table exists hits a nil-map panic — common on fresh create/restore. Mirror the guard the sibling token path already has: init the map when nil, then write.

TokenAdd wrote to account.EntriesNative without a nil-guard, so on a freshly
created or restored, not-yet-synced wallet (EntriesNative is populated lazily
during sync) the assignment panicked with "assignment to entry in nil map".
Its sibling InsertReplace already has this guard; TokenAdd was missing it.

Surfaced by opening a freshly restored, unregistered wallet — common for
cold-storage wallets that are unregistered until their registration is
broadcast. Branched off the release-pinned commit so the fix carries no
unrelated changes.
DHEBP pushed a commit to DHEBP/derohe that referenced this pull request Jul 14, 2026
Cherry-pick of DEROFDN#44 onto transmission-alpha-base so the Transmission
protocol pin carries all advertised correctness fixes (DEROFDN#20, DEROFDN#44, DEROFDN#45,
proof-hardening).
moralpriest added a commit to moralpriest/derohe that referenced this pull request Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant