wallet/refactor: change PSBTError to PSBTResult and remove std::optional<common::PSBTResult> and return common::PSBTResult #32958

pull kevkevinpal wants to merge 5 commits into bitcoin:master from kevkevinpal:PSBTErrorToPSBTResult changing 23 files +105 −105
  1. kevkevinpal commented at 2:06 PM on July 13, 2025: contributor

    Description

    This is a follow-up to #31622 (review) and #31622 (review)

    What this changes

    • Updates PSBTError to PSBTResult because we now have PSBTResult::OK

    • Updates PSBTErrorString to PSBTResultString

    • Updates RPCErrorFromPSBTError to RPCErrorFromPSBTResult

    • Removes std::optional<common::PSBTResult> and instead returns just common::PSBTResult replacing when we return null with PSBTResult::OK

  2. DrahtBot commented at 2:06 PM on July 13, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32958.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK naiyoma

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #33008 (wallet: support bip388 policy with external signer by Sjors)
    • #32876 (refactor: use options struct for signing and PSBT operations by Sjors)
    • #32857 (wallet: allow skipping script paths by Sjors)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, &txdata, input.sighash_type, nullptr, true) == PSBTResult::OK in src/psbt.cpp
    • m_wallet.FillPSBT(psbtx, complete, std::nullopt, false, true) == PSBTResult::OK in src/wallet/test/psbt_wallet_tests.cpp
    • m_wallet.FillPSBT(psbtx, complete, std::nullopt, true, true) != PSBTResult::OK in src/wallet/test/psbt_wallet_tests.cpp

    <sup>2026-04-01 15:37:28</sup>

  3. kevkevinpal force-pushed on Jul 13, 2025
  4. DrahtBot added the label CI failed on Jul 13, 2025
  5. DrahtBot commented at 2:12 PM on July 13, 2025: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task ARM, unit tests, no functional tests: https://github.com/bitcoin/bitcoin/runs/45878284919</sub> <sub>LLM reason (✨ experimental): The CI failure is caused by compilation errors due to incorrect handling of PSBTResult objects in psbtoperationsdialog.cpp.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  6. kevkevinpal force-pushed on Jul 13, 2025
  7. kevkevinpal force-pushed on Jul 13, 2025
  8. kevkevinpal force-pushed on Jul 13, 2025
  9. DrahtBot removed the label CI failed on Jul 13, 2025
  10. naiyoma commented at 5:51 PM on August 11, 2025: contributor

    Concept ACK

    l have looked at 87736a986d510e1ea72dfa7051284b3335d124a0, 595909674ea70c34363053831ffc633975605865 and 125431e6afaf10816a09c6ba6a41c2af086b5558 changes, LGTM

    makes sense to rename since PSBTError::OK is not an error.

    PSBTError is consistent with TransactionError, https://github.com/bitcoin/bitcoin/blob/master/src/node/types.h#L24 so maybe TransactionError should also be renamed in a follow-up PR.

  11. in src/qt/psbtoperationsdialog.cpp:62 in 595909674e outdated
      61 | @@ -62,7 +62,7 @@ void PSBTOperationsDialog::openWithPSBT(PartiallySignedTransaction psbtx)
      62 |          const auto err{m_wallet_model->wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, &n_could_sign, m_transaction_data, complete)};
    


    naiyoma commented at 6:06 PM on August 11, 2025:

    nit: rename err -> result


    kevkevinpal commented at 7:05 PM on August 11, 2025:

    Thanks for the review! pushed an update in d242c75c5c0eb7d5515cc99fda39ff98a6fdd5af

  12. kevkevinpal force-pushed on Aug 11, 2025
  13. naiyoma commented at 8:42 PM on August 13, 2025: contributor

    utack d242c75c5c0eb7d5515cc99fda39ff98a6fdd5af Haven't done thorough testing yet, but returning an explicit PSBTResult::OK when there's no error is clearer and more optimal than using an optional wrapper.

  14. DrahtBot added the label Needs rebase on Oct 24, 2025
  15. kevkevinpal force-pushed on Oct 24, 2025
  16. kevkevinpal commented at 8:46 PM on October 24, 2025: contributor

    Just rebased the PR to 86d9a82 since @DrahtBot was upset

  17. DrahtBot removed the label Needs rebase on Oct 24, 2025
  18. kevkevinpal requested review from naiyoma on Oct 26, 2025
  19. in src/qt/sendcoinsdialog.cpp:510 in 86d9a82cc8
     508 | @@ -509,7 +509,7 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
     509 |          // Fill without signing
     510 |          const auto err{model->wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, /*n_signed=*/nullptr, psbtx, complete)};
    


    TumaBitcoiner commented at 3:59 PM on November 21, 2025:
            const auto result{model->wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, /*n_signed=*/nullptr, psbtx, complete)};
    

    Should this be defined as result too, as you did in other parts of the code?


    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  20. in src/qt/sendcoinsdialog.cpp:512 in 86d9a82cc8
     508 | @@ -509,7 +509,7 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
     509 |          // Fill without signing
     510 |          const auto err{model->wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, /*n_signed=*/nullptr, psbtx, complete)};
     511 |          assert(!complete);
     512 | -        assert(!err);
     513 | +        assert(err == PSBTResult::OK);
    


    TumaBitcoiner commented at 3:59 PM on November 21, 2025:
            assert(result== PSBTResult::OK);
    

    As above.


    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  21. in src/qt/sendcoinsdialog.cpp:526 in 86d9a82cc8
     524 | @@ -525,7 +525,7 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
     525 |              // from being called prematurely and is not expensive.
     526 |              const auto err{model->wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, /*n_signed=*/nullptr, psbtx, complete)};
    


    TumaBitcoiner commented at 4:03 PM on November 21, 2025:
                const auto result{model->wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, /*n_signed=*/nullptr, psbtx, complete)};
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  22. in src/qt/sendcoinsdialog.cpp:528 in 86d9a82cc8
     524 | @@ -525,7 +525,7 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
     525 |              // from being called prematurely and is not expensive.
     526 |              const auto err{model->wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, /*n_signed=*/nullptr, psbtx, complete)};
     527 |              assert(!complete);
     528 | -            assert(!err);
     529 | +            assert(err == PSBTResult::OK);
    


    TumaBitcoiner commented at 4:03 PM on November 21, 2025:
                assert(result== PSBTResult::OK);
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  23. in src/qt/walletmodel.cpp:523 in 86d9a82cc8
     520 | @@ -521,7 +521,7 @@ bool WalletModel::bumpFee(Txid hash, Txid& new_hash)
     521 |          PartiallySignedTransaction psbtx(mtx);
     522 |          bool complete = false;
     523 |          const auto err{wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, nullptr, psbtx, complete)};
    


    TumaBitcoiner commented at 4:03 PM on November 21, 2025:
            const auto result{wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, nullptr, psbtx, complete)};
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  24. in src/qt/walletmodel.cpp:524 in 86d9a82cc8
     520 | @@ -521,7 +521,7 @@ bool WalletModel::bumpFee(Txid hash, Txid& new_hash)
     521 |          PartiallySignedTransaction psbtx(mtx);
     522 |          bool complete = false;
     523 |          const auto err{wallet().fillPSBT(std::nullopt, /*sign=*/false, /*bip32derivs=*/true, nullptr, psbtx, complete)};
     524 | -        if (err || complete) {
     525 | +        if (err != PSBTResult::OK || complete) {
    


    TumaBitcoiner commented at 4:04 PM on November 21, 2025:
            if (result != PSBTResult::OK || complete) {
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  25. in src/wallet/feebumper.cpp:340 in 86d9a82cc8
     337 | @@ -338,7 +338,7 @@ bool SignTransaction(CWallet& wallet, CMutableTransaction& mtx) {
     338 |          bool complete;
     339 |          wallet.FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/true);
     340 |          auto err{wallet.FillPSBT(psbtx, complete, std::nullopt, /*sign=*/true, /*bip32derivs=*/false)};
    


    TumaBitcoiner commented at 4:07 PM on November 21, 2025:
            auto result{wallet.FillPSBT(psbtx, complete, std::nullopt, /*sign=*/true, /*bip32derivs=*/false)};
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  26. in src/wallet/feebumper.cpp:341 in 86d9a82cc8
     337 | @@ -338,7 +338,7 @@ bool SignTransaction(CWallet& wallet, CMutableTransaction& mtx) {
     338 |          bool complete;
     339 |          wallet.FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/true);
     340 |          auto err{wallet.FillPSBT(psbtx, complete, std::nullopt, /*sign=*/true, /*bip32derivs=*/false)};
     341 | -        if (err) return false;
     342 | +        if (err != PSBTResult::OK) return false;
    


    TumaBitcoiner commented at 4:07 PM on November 21, 2025:
            if (result != PSBTResult::OK) return false;
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  27. in src/wallet/rpc/spend.cpp:118 in 86d9a82cc8
     115 | @@ -116,8 +116,8 @@ static UniValue FinishTransaction(const std::shared_ptr<CWallet> pwallet, const
     116 |      bool complete;
     117 |      pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/true);
     118 |      const auto err{pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/true, /*bip32derivs=*/false)};
    


    TumaBitcoiner commented at 4:08 PM on November 21, 2025:
        const auto result{pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/true, /*bip32derivs=*/false)};
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  28. in src/wallet/rpc/spend.cpp:1193 in 86d9a82cc8
    1190 | @@ -1191,7 +1191,7 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
    1191 |          PartiallySignedTransaction psbtx(mtx);
    1192 |          bool complete = false;
    1193 |          const auto err{pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/true)};
    


    TumaBitcoiner commented at 4:09 PM on November 21, 2025:
            const auto result{pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/true)};
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  29. in src/wallet/rpc/spend.cpp:1194 in 86d9a82cc8
    1190 | @@ -1191,7 +1191,7 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
    1191 |          PartiallySignedTransaction psbtx(mtx);
    1192 |          bool complete = false;
    1193 |          const auto err{pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/true)};
    1194 | -        CHECK_NONFATAL(!err);
    1195 | +        CHECK_NONFATAL(err == PSBTResult::OK);
    


    TumaBitcoiner commented at 4:09 PM on November 21, 2025:
            CHECK_NONFATAL(result == PSBTResult::OK);
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  30. in src/wallet/rpc/spend.cpp:1681 in 86d9a82cc8
    1678 | @@ -1679,8 +1679,8 @@ RPCHelpMan walletprocesspsbt()
    1679 |      if (sign) EnsureWalletIsUnlocked(*pwallet);
    1680 |  
    1681 |      const auto err{wallet.FillPSBT(psbtx, complete, nHashType, sign, bip32derivs, nullptr, finalize)};
    


    TumaBitcoiner commented at 4:09 PM on November 21, 2025:
        const auto result{wallet.FillPSBT(psbtx, complete, nHashType, sign, bip32derivs, nullptr, finalize)};
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  31. in src/wallet/rpc/spend.cpp:119 in 86d9a82cc8
     115 | @@ -116,8 +116,8 @@ static UniValue FinishTransaction(const std::shared_ptr<CWallet> pwallet, const
     116 |      bool complete;
     117 |      pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/true);
     118 |      const auto err{pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/true, /*bip32derivs=*/false)};
     119 | -    if (err) {
     120 | -        throw JSONRPCPSBTError(*err);
     121 | +    if (err != PSBTResult::OK) {
    


    TumaBitcoiner commented at 4:12 PM on November 21, 2025:
        if (result != PSBTResult::OK) {
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  32. in src/wallet/rpc/spend.cpp:120 in 86d9a82cc8
     115 | @@ -116,8 +116,8 @@ static UniValue FinishTransaction(const std::shared_ptr<CWallet> pwallet, const
     116 |      bool complete;
     117 |      pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/true);
     118 |      const auto err{pwallet->FillPSBT(psbtx, complete, std::nullopt, /*sign=*/true, /*bip32derivs=*/false)};
     119 | -    if (err) {
     120 | -        throw JSONRPCPSBTError(*err);
     121 | +    if (err != PSBTResult::OK) {
     122 | +        throw JSONRPCPSBTError(err);
    


    TumaBitcoiner commented at 4:12 PM on November 21, 2025:
            throw JSONRPCPSBTError(result);
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  33. in src/wallet/rpc/spend.cpp:1682 in 86d9a82cc8
    1678 | @@ -1679,8 +1679,8 @@ RPCHelpMan walletprocesspsbt()
    1679 |      if (sign) EnsureWalletIsUnlocked(*pwallet);
    1680 |  
    1681 |      const auto err{wallet.FillPSBT(psbtx, complete, nHashType, sign, bip32derivs, nullptr, finalize)};
    1682 | -    if (err) {
    1683 | -        throw JSONRPCPSBTError(*err);
    1684 | +    if (err != PSBTResult::OK) {
    


    TumaBitcoiner commented at 4:12 PM on November 21, 2025:
        if (result != PSBTResult::OK) {
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  34. in src/wallet/rpc/spend.cpp:1683 in 86d9a82cc8
    1678 | @@ -1679,8 +1679,8 @@ RPCHelpMan walletprocesspsbt()
    1679 |      if (sign) EnsureWalletIsUnlocked(*pwallet);
    1680 |  
    1681 |      const auto err{wallet.FillPSBT(psbtx, complete, nHashType, sign, bip32derivs, nullptr, finalize)};
    1682 | -    if (err) {
    1683 | -        throw JSONRPCPSBTError(*err);
    1684 | +    if (err != PSBTResult::OK) {
    1685 | +        throw JSONRPCPSBTError(err);
    


    TumaBitcoiner commented at 4:13 PM on November 21, 2025:
            throw JSONRPCPSBTError(result);
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  35. in src/wallet/rpc/spend.cpp:1823 in 86d9a82cc8
    1820 | @@ -1821,8 +1821,8 @@ RPCHelpMan walletcreatefundedpsbt()
    1821 |      bool bip32derivs = request.params[4].isNull() ? true : request.params[4].get_bool();
    1822 |      bool complete = true;
    1823 |      const auto err{wallet.FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/bip32derivs)};
    


    TumaBitcoiner commented at 4:13 PM on November 21, 2025:
        const auto result{wallet.FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/bip32derivs)};
    

    kevkevinpal commented at 5:26 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  36. in src/wallet/rpc/spend.cpp:1824 in 86d9a82cc8
    1820 | @@ -1821,8 +1821,8 @@ RPCHelpMan walletcreatefundedpsbt()
    1821 |      bool bip32derivs = request.params[4].isNull() ? true : request.params[4].get_bool();
    1822 |      bool complete = true;
    1823 |      const auto err{wallet.FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/bip32derivs)};
    1824 | -    if (err) {
    1825 | -        throw JSONRPCPSBTError(*err);
    1826 | +    if (err != PSBTResult::OK) {
    


    TumaBitcoiner commented at 4:13 PM on November 21, 2025:
        if (result != PSBTResult::OK) {
    

    kevkevinpal commented at 5:25 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  37. in src/wallet/rpc/spend.cpp:1825 in 86d9a82cc8
    1820 | @@ -1821,8 +1821,8 @@ RPCHelpMan walletcreatefundedpsbt()
    1821 |      bool bip32derivs = request.params[4].isNull() ? true : request.params[4].get_bool();
    1822 |      bool complete = true;
    1823 |      const auto err{wallet.FillPSBT(psbtx, complete, std::nullopt, /*sign=*/false, /*bip32derivs=*/bip32derivs)};
    1824 | -    if (err) {
    1825 | -        throw JSONRPCPSBTError(*err);
    1826 | +    if (err != PSBTResult::OK) {
    1827 | +        throw JSONRPCPSBTError(err);
    


    TumaBitcoiner commented at 4:13 PM on November 21, 2025:
            throw JSONRPCPSBTError(result);
    

    kevkevinpal commented at 5:25 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  38. in src/wallet/wallet.cpp:2159 in 86d9a82cc8
    2156 | @@ -2157,7 +2157,7 @@ std::optional<PSBTError> CWallet::FillPSBT(PartiallySignedTransaction& psbtx, bo
    2157 |      for (ScriptPubKeyMan* spk_man : GetAllScriptPubKeyMans()) {
    2158 |          int n_signed_this_spkm = 0;
    2159 |          const auto error{spk_man->FillPSBT(psbtx, txdata, sighash_type, sign, bip32derivs, &n_signed_this_spkm, finalize)};
    


    TumaBitcoiner commented at 4:15 PM on November 21, 2025:
            const auto result{spk_man->FillPSBT(psbtx, txdata, sighash_type, sign, bip32derivs, &n_signed_this_spkm, finalize)};
    

    kevkevinpal commented at 5:25 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  39. in src/wallet/wallet.cpp:2160 in 86d9a82cc8
    2156 | @@ -2157,7 +2157,7 @@ std::optional<PSBTError> CWallet::FillPSBT(PartiallySignedTransaction& psbtx, bo
    2157 |      for (ScriptPubKeyMan* spk_man : GetAllScriptPubKeyMans()) {
    2158 |          int n_signed_this_spkm = 0;
    2159 |          const auto error{spk_man->FillPSBT(psbtx, txdata, sighash_type, sign, bip32derivs, &n_signed_this_spkm, finalize)};
    2160 | -        if (error) {
    2161 | +        if (error != PSBTResult::OK) {
    


    TumaBitcoiner commented at 4:15 PM on November 21, 2025:
            if (result != PSBTResult::OK) {
    

    kevkevinpal commented at 5:25 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  40. in src/wallet/wallet.cpp:2161 in 86d9a82cc8
    2156 | @@ -2157,7 +2157,7 @@ std::optional<PSBTError> CWallet::FillPSBT(PartiallySignedTransaction& psbtx, bo
    2157 |      for (ScriptPubKeyMan* spk_man : GetAllScriptPubKeyMans()) {
    2158 |          int n_signed_this_spkm = 0;
    2159 |          const auto error{spk_man->FillPSBT(psbtx, txdata, sighash_type, sign, bip32derivs, &n_signed_this_spkm, finalize)};
    2160 | -        if (error) {
    2161 | +        if (error != PSBTResult::OK) {
    2162 |              return error;
    


    TumaBitcoiner commented at 4:15 PM on November 21, 2025:
                return result;
    

    kevkevinpal commented at 5:25 PM on November 21, 2025:

    Thanks, updated in 4e038c4b7a6fbfaafe1f2570592e2bb751f9be09

  41. TumaBitcoiner commented at 4:17 PM on November 21, 2025: none

    I made some suggestions to keep consistency between naming and files. Sometimes result was used, other times err.

  42. kevkevinpal force-pushed on Nov 21, 2025
  43. DrahtBot added the label CI failed on Nov 21, 2025
  44. DrahtBot commented at 5:36 PM on November 21, 2025: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task Windows-cross to x86_64: https://github.com/bitcoin/bitcoin/actions/runs/19578345228/job/56069612685</sub> <sub>LLM reason (✨ experimental): C++ compilation failure in wallet/spend.cpp due to using a const PSBTResult where pushKV is invoked, causing a type/return mismatch.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  45. kevkevinpal force-pushed on Nov 21, 2025
  46. kevkevinpal force-pushed on Nov 21, 2025
  47. DrahtBot removed the label CI failed on Nov 21, 2025
  48. kevkevinpal force-pushed on Dec 31, 2025
  49. kevkevinpal commented at 7:22 PM on December 31, 2025: contributor

    rebased to dd51b84

  50. DrahtBot added the label Needs rebase on Jan 19, 2026
  51. kevkevinpal force-pushed on Mar 13, 2026
  52. kevkevinpal commented at 7:54 PM on March 13, 2026: contributor

    Rebased to 4e92ac8

  53. DrahtBot added the label CI failed on Mar 13, 2026
  54. DrahtBot removed the label Needs rebase on Mar 13, 2026
  55. DrahtBot commented at 2:31 PM on March 18, 2026: contributor

    Could turn into draft while CI is red?

  56. kevkevinpal force-pushed on Mar 18, 2026
  57. kevkevinpal force-pushed on Mar 18, 2026
  58. kevkevinpal force-pushed on Mar 18, 2026
  59. kevkevinpal force-pushed on Mar 18, 2026
  60. DrahtBot removed the label CI failed on Mar 18, 2026
  61. DrahtBot added the label Needs rebase on Mar 25, 2026
  62. refactor: Updated PSBTError to PSBTResult
    PSBTError now contains the PSBTError::Ok type which means it makes sense
    to rename it into PSBTResult since there is a case where it does not
    error
    cbea448eb6
  63. refactor: rename PSBTErrorString to PSBTResultString 68e8595bcf
  64. refactor: RPCErrorFromPSBTError to RPCErrorFromPSBTResult c28ddc05a2
  65. wallet: remove std::optional when PSBTResult is returned
    PSBTResult has an enum value of OK, so it makes sense to return OK
    insead of a {}. This change makes it so we check for an OK value instead
    of null/{}
    d5e6cc23ff
  66. refactor: rename err/error -> result when a PSBTResult
    Since changing PSBTError -> PSBTResult it makes sense to change the
    variable names to reflect that it is not always an error and sometimes
    can have the value of OK
    f6a5a434d1
  67. kevkevinpal force-pushed on Apr 1, 2026
  68. kevkevinpal commented at 3:37 PM on April 1, 2026: contributor

    Rebased to f6a5a43

  69. DrahtBot removed the label Needs rebase on Apr 1, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-15 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me