Lazy load tx inputs in Bitcoin Core mode #1643
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #465
The issue
When opening block 736192 (0000000000000000000405c3eb4af4ca6361275baa347c35c8afb6bef09a9d4b) when running Bitcoin Core.. The transactions list is timing out due to the amount of transactions with 100 inputs each.

And in other occasions with less inputs the transactions list can be extremely slow when running Bitcoin core, for Raspberry Pi users.
What this PR does
Limiting the fetching of inputs to 12 (which is the limit we use before displaying the "Load all (90)" button. Suddenly we can load the page without timeout. And we can flip through pages without super slowdowns. This affects the Block transactions view and Address page view, and it won't effect the individual transaction view.
The only downside is that we can't calculate the fee (missing from down left) without knowing all the inputs.
After clicking Load all the inputs are lazily loaded:
Scrolling to the bottom we can now see the fee.
How to test
Make sure the features mentioned above should work on the Block transactions page and the Address page containing transactions with many inputs. Going to an individual transaction should still work. This should not be present when using Esplora.