Skip to content

Context: auto-set default Context, remove strict mode enforcement. - #4344

Open
msgilligan wants to merge 3 commits into
bitcoinj:masterfrom
msgilligan:msgilligan/Context-remove-strict-mode
Open

msgilligan wants to merge 3 commits into
bitcoinj:masterfrom
msgilligan:msgilligan/Context-remove-strict-mode

Conversation

@msgilligan

@msgilligan msgilligan commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Two commits:

  1. enableStrictMode() is deprecated, but this commit removes enforcement even if enableStrictMode() is called.
  2. Rather than fail if no lastConstructed context is available, creating a default context.

This implements step 2 in:

enableStrictMode() is deprecated, but this commit
removes enforcement even if enableStrictMode() is called.
@msgilligan
msgilligan requested a review from schildbach August 26, 2026 01:52
@msgilligan msgilligan added this to the 0.18 milestone Aug 26, 2026
@msgilligan msgilligan added the Context Related to removal of the ThreadLocal Context object label Aug 26, 2026
@msgilligan msgilligan changed the title Context: remove strict mode enforcement. Context: auto-set default Context, remove strict mode enforcement. Aug 26, 2026
It is no longer necessary in a standalone app as the Context
will be initialized automatically to the default.
@msgilligan
msgilligan force-pushed the msgilligan/Context-remove-strict-mode branch from 1d1f442 to 40d018a Compare August 26, 2026 04:30
@msgilligan msgilligan mentioned this pull request Aug 26, 2026
2 of 9 tasks
@schildbach

Copy link
Copy Markdown
Member

I see no chance of merging this before we find a new home for confidenceTable. Or alternatively completely rethink and rewrite how transaction confidence works.

@schildbach

Copy link
Copy Markdown
Member

If we want to reduce the "impact" of strict mode (or the side effects of not using it), we need to reduce calls to Context.get() and Context.getOrCreate(). Once that is all gone from non-test code, we can remove strict mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Context Related to removal of the ThreadLocal Context object Priority high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants