Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wallet): only mark change address used if create_tx succeeds #1579

Merged

Commits on Sep 9, 2024

  1. fix(wallet): only mark change address used if create_tx succeeds

    If no drain script is specified in tx params then we get it from
    the change keychain by looking at the next unused address. We want
    to mark the change address used so that other callers won't attempt
    to use the same address between the time we create the tx and when
    it appears on chain.
    
    Before, we marked the index used regardless of whether a change
    output is finally added. Then if creating a PSBT failed, we never
    restored the unused status of the change address, so creating the
    next tx would have revealed an extra one. Now we only mark the change
    address used if we successfully create a PSBT and the drain script
    is used in the change output.
    ValuedMammal committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    b60d1d2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    75989d8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    606fa08 View commit details
    Browse the repository at this point in the history