Describe the bug
When I create a PSBT using TxBuilder, we typically add the recipients, amounts, and other necessary data, and everything works as expected. However, sometimes when we receive an InsufficientFunds exception, the change address index increases, causing it to be skipped in next call to create_psbt, which then selects a new unused one.
In the create_psbt function and noticed that the latest unused index in the KeychainKind::Internal is marked as used first, but when the InsufficientFunds exception occurs, it doesn’t reset back to unused.
please take a look thx
Describe the bug
When I create a PSBT using TxBuilder, we typically add the recipients, amounts, and other necessary data, and everything works as expected. However, sometimes when we receive an InsufficientFunds exception, the change address index increases, causing it to be skipped in next call to create_psbt, which then selects a new unused one.
In the create_psbt function and noticed that the latest unused index in the KeychainKind::Internal is marked as used first, but when the InsufficientFunds exception occurs, it doesn’t reset back to unused.
please take a look thx