At the moment BDK stops syncing after it finds stop_gap addresses that don't have any associated tx. But what if has a utxo for an address after stop gap in the database. Despite BDK not scanning for them it can still find these utxos because they might be on a transaction that bdk is already interested for other reasons.
I think another way of thinking about it is that bdk should always sync addresses it has given out regardless if they fall after stop_gap empty addresses. In fact, stop gap shouldn't be used except for when doing an initial sync. BDK should just look up to the highest index address in the database (i.e. the highest index of an address it has given out).
At the moment BDK stops syncing after it finds
stop_gapaddresses that don't have any associated tx. But what if has a utxo for an address after stop gap in the database. Despite BDK not scanning for them it can still find these utxos because they might be on a transaction that bdk is already interested for other reasons.I think another way of thinking about it is that bdk should always sync addresses it has given out regardless if they fall after
stop_gapempty addresses. In fact, stop gap shouldn't be used except for when doing an initial sync. BDK should just look up to the highest index address in the database (i.e. the highest index of an address it has given out).