-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(chain)!: Add time_of_sync
to SyncRequest
and FullScanRequest
WIP
#1566
Conversation
47d602e
to
806b99b
Compare
806b99b
to
e47204a
Compare
pub fn update_last_seen_unconfirmed(&mut self, seen_at: u64) -> ChangeSet<A> { | ||
let mut changeset = ChangeSet::default(); | ||
let unanchored_txs: Vec<Txid> = self | ||
.txs | ||
.iter() | ||
.filter_map( | ||
|(&txid, (_, anchors))| { | ||
if anchors.is_empty() { | ||
Some(txid) | ||
} else { | ||
None | ||
} | ||
}, | ||
) | ||
.collect(); | ||
|
||
for txid in unanchored_txs { | ||
changeset.merge(self.insert_seen_at(txid, seen_at)); | ||
} | ||
changeset | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think removing this method should really be a separate commit. However, I'm wondering if there is an argument to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My 2 sats is if both wallet and non-wallet based app will use SyncRequest
and FullScanRequest
then this shouldn't be needed.
e47204a
to
1b2a840
Compare
1b2a840
to
9b75eeb
Compare
Implements #1550.
Description
Adds
time_of_sync
as a member ofSyncRequest
andFullSyncRequest
so we can set thelast_seen
for unconfirmed transactions during the sync/scan process inbdk_electrum
.Notes to the reviewers
This PR is a WIP because setting the
last_seen
for unconfirmed transactions during the sync/scan process is yet to be implemented forbdk_esplora
. I pushed my WIP towards setting thelast_seen
forbdk_esplora
but I'm unsure if it is correct, as I did not have enough time to confirm and write a test for it before my travel. Please feel free to drop that commit if the concept is incorrect.Changelog notice
update_last_seen_unconfirmed()
fromTxGraph
.time_of_sync
as a member ofSyncRequest
.time_of_sync
as a member ofFullScanRequest
.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features: