Open evanlinjin opened 3 months ago
Is this fixed by #1579 ?
This is an issue about a new feature that would stop revealing new addresses passed the stop gap. It's related to #1579 as it would have softened the problem for the user who doesn't called cancel_tx
but it is not fixed by resolving that.
If this a new feature request can we move it out of the 1.0 beta milestone?
Describe the situation
An undisclosed user of ours ran into an issue where creating multiple unbroadcasted transactions resulted in incrementing the revealed index for the internal keychain too rapidly. Eventually, the gap of unused addresses surpassed the
stop_gap
set for the spk-based chain source, thus some transactions were not caught by the syncing process.This is caused by
Wallet::create_tx
which marks change addresses as used. https://github.com/bitcoindevkit/bdk/blob/775e4aee3a9ec2d99adb129f7a9367a3a15c7032/crates/wallet/src/wallet/mod.rs#L1460The correct use of the current API would be to call
Wallet::cancel_tx
. However, I would argue that this is unwieldy and not immediately apparent. https://github.com/bitcoindevkit/bdk/blob/775e4aee3a9ec2d99adb129f7a9367a3a15c7032/crates/wallet/src/wallet/mod.rs#L1963Also, recently another user mentioned trying to implement some sort of address-recycling logic on Discord @
#bdk-users
.What to do
Not sure, let's discuss.