mirror of
https://github.com/LORDBABUINO/stealth.git
synced 2026-05-04 11:19:08 -07:00
fixup! feat(engine): create engine rust package for detectors and orchestration
Seed TxGraph ownership state from all derived addresses, not just addresses discovered from transaction outputs. This makes is_ours() recognize every descriptor-derived address and preserves internal/change tagging separately.
This commit is contained in:
@@ -171,6 +171,7 @@ impl<'a, G: BlockchainGateway> AnalysisEngine<'a, G> {
|
||||
utxos: utxo_entries,
|
||||
transactions,
|
||||
internal_addresses: HashSet::new(),
|
||||
derived_addresses: HashSet::new(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,6 +140,18 @@ impl TxGraph {
|
||||
})
|
||||
.collect();
|
||||
|
||||
// Add ALL derived addresses to `our_addrs` and `addr_map`, matching
|
||||
// the Python reference (`our_addrs = set(addr_map.keys())` where
|
||||
// `addr_map` contains every address derived from the descriptors).
|
||||
for addr in &history.derived_addresses {
|
||||
our_addrs.insert(addr.clone());
|
||||
addr_map.entry(addr.clone()).or_insert_with(|| AddressInfo {
|
||||
script_type: script_type_from_address(addr),
|
||||
internal: history.internal_addresses.contains(addr),
|
||||
index: 0,
|
||||
});
|
||||
}
|
||||
|
||||
// Pre-populate caches from decoded transactions.
|
||||
let mut tx_cache = HashMap::new();
|
||||
let mut input_cache: HashMap<Txid, Vec<InputInfo>> = HashMap::new();
|
||||
|
||||
Reference in New Issue
Block a user