Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Client-controlled limits bypass the scan ceiling, and collation uses quadratic duplicate tracking.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds filtered address and scripthash transaction history by direction, amount, height, and timestamp.
Changes:
- Parses and validates transaction filters.
- Filters mempool and confirmed histories with pagination metadata.
- Adds a configurable confirmed-history scan limit.
| File | Description |
|---|---|
src/util/tx_filter.rs |
Defines filter parsing, validation, and matching. |
src/util/mod.rs |
Exports filter types. |
src/rest.rs |
Integrates filters and truncation headers. |
src/new_index/schema.rs |
Implements confirmed-history filtering and collation. |
src/new_index/mod.rs |
Exports scan outcomes. |
src/new_index/mempool.rs |
Implements mempool filtering. |
src/config.rs |
Adds the scan-limit option. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| }) | ||
| .collect::<Result<Vec<_>, _>>()?; | ||
| &filter, | ||
| cmp::max(config.rest_max_address_txs_filter_scan, max_txs), |
Comment on lines
+2180
to
+2202
| let mut txs: Vec<(SlotTx, Vec<(u32, bool)>)> = Vec::new(); | ||
| for row in rows { | ||
| let txid = row.get_txid(); | ||
| let entry = (row.key.txinfo.get_vin_or_vout(), row.key.txinfo.has_vin()); | ||
| let delta = row.key.txinfo.net_delta(); | ||
| match txs.iter_mut().find(|(tx, _)| tx.txid == txid) { | ||
| Some((tx, entries)) => { | ||
| if !entries.contains(&entry) { | ||
| entries.push(entry); | ||
| tx.value = tx.value.saturating_add(delta); | ||
| } | ||
| } | ||
| None => txs.push(( | ||
| SlotTx { | ||
| txid, | ||
| row_height: row.key.confirmed_height, | ||
| tx_position: row.key.tx_position, | ||
| value: delta, | ||
| }, | ||
| vec![entry], | ||
| )), | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Vibe coded 🎧 support of filtered tx responses in
/address/<addr>/txsFor the purpose of #6697 to make #6775 work
Filters available: