fix(sync): skip output message check when not syncing spent outputs
@@ -729,6 +729,9 @@ impl AccountSynchronizer {
// we use this flag in case the new balance is 0
let mut emitted_event = false;
// check new and updated outputs to find message ids
+ // note that this is unreliable if we're not syncing spent outputs,
+ // since not all information are collected.
+ if self.account_handle.account_options.sync_spent_outputs {
for output in address_after_sync.outputs() {
if !before_sync_outputs.contains(&output) {
emit_balance_change(
@@ -747,6 +750,7 @@ impl AccountSynchronizer {
emitted_event = true;
}
}
+ }
// we can't guarantee we picked up all output changes since querying spent outputs is
// optional so we handle it here; if not all balance change has
