Skip to content

PSBT Creation: Change Address Index Skipped on InsufficientFunds #1578

@zhj4478

Description

@zhj4478

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions