You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be quite a few independent efforts to define and address problems with the syncing/scanning API. I thought it would be nice to organize them in one place and have a single PR that does all of them.
/// A list of blockchain entities for which we want to receive any related transaction data.structSyncRequest{/// transactions that spend from or two these script pubkeysspks:Vec<ScriptBuf>,/// Transactions with these txids txids:Vec<Txid>,/// Transactions with these outpoints or spend from these outpointsoutpoints:Vec<OutPoint>,/// The local chain checkpoint. The sync process will return a new chain that extends this one.checkpoint:Option<CheckPoint>}/// Script pubkeys indexed by their keychain.structRescanRequest<K,I>{/// Iterators of script pubkeys indexed by the keychain indexspks_by_keychain:BTreeMap<K,I>,/// The local chain checkpoint. The scan process will return a new chain that extends this one.checkpoint:Option<CheckPoint>}
Now the problem with the above is that we want to be able to easy log when a new spk etc is drawn by the blockchain. So really we can't have these fields public -- internally each thing should be Box<dyn Iterator<Item = ...>>. Then when you add a new items to the SyncRequest it should be something like SyncRequest::append_spks(&mut self, spks: impl IntoIterator<Item=ScriptBuf>) which would append the new iterator onto the existing one with chain and replace it.
There seems to be quite a few independent efforts to define and address problems with the syncing/scanning API. I thought it would be nice to organize them in one place and have a single PR that does all of them.
stop_gapstyle scanning must necessarily be assuming that another wallet must have given out addresses prior to this one. The namerescancommunicates this better (h/t @danielabrozzoni). Relatedscan_without_keychainandscan's names should be inverted #1112.bdk_chainthat define bundles of things aWallet(or any other system) could be interested in. I think these should be:Box<dyn Iterator<Item = ...>>. Then when you add a new items to theSyncRequestit should be something likeSyncRequest::append_spks(&mut self, spks: impl IntoIterator<Item=ScriptBuf>)which would append the new iterator onto the existing one withchainand replace it.