wallet/refactor: change PSBTError to PSBTResult and remove std::optionalcommon::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

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK naiyoma

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

    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)
    • #31650 (refactor: Avoid copies by using const references or by move-construction by maflcko)
    • #21283 (Implement BIP 370 PSBTv2 by achow101)

    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.

    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, std::nullopt, &outdata) in src/node/psbt.cpp
    • SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, nullptr, std::nullopt) in src/node/psbt.cpp
    • SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, &txdata, input.sighash_type, nullptr, true) in src/psbt.cpp
    • FillPSBT(psbtx, complete, std::nullopt, /sign=/true, /bip32derivs=/false) in src/wallet/feebumper.cpp
    • FillPSBT(psbtx, complete, std::nullopt, /sign=/true, /bip32derivs=/false) in src/wallet/rpc/spend.cpp
    • FillPSBT(psbtx, complete, std::nullopt, false, true) in src/wallet/test/psbt_wallet_tests.cpp
    • SignPSBTInput(HidingSigningProvider(…), psbtx, i, &txdata, sighash_type, nullptr, finalize) in src/wallet/scriptpubkeyman.cpp
    • DescriptorScriptPubKeyMan::FillPSBT(psbt, txdata, sighash_type, false, bip32derivs, n_signed, finalize) in src/wallet/external_signer_scriptpubkeyman.cpp

    No suggestions were made for calls that already use named comments for the literals or where the literal is among the first two arguments.

    2025-12-31

  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

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

    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.

  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:
    0        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:
    0        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:
    0            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:
    0            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:
    0        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:
    0        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:
    0        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:
    0        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:
    0    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:
    0        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:
    0        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:
    0    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:
    0    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:
    0        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:
    0    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:
    0        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:
    0    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:
    0    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:
    0        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:
    0        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:
    0        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:
    0            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

    🚧 At least one of the CI tasks failed. Task Windows-cross to x86_64: https://github.com/bitcoin/bitcoin/actions/runs/19578345228/job/56069612685 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.

    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.

  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. 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
    45acac8d18
  49. refactor: rename PSBTErrorString to PSBTResultString d2d4177809
  50. refactor: RPCErrorFromPSBTError to RPCErrorFromPSBTResult f530980574
  51. 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/{}
    8cc7e0e078
  52. 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
    dd51b84161
  53. kevkevinpal force-pushed on Dec 31, 2025
  54. kevkevinpal commented at 7:22 pm on December 31, 2025: contributor
    rebased to dd51b84
  55. DrahtBot added the label Needs rebase on Jan 19, 2026
  56. DrahtBot commented at 12:11 pm on January 19, 2026: contributor
    🐙 This pull request conflicts with the target branch and needs rebase.

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-01-31 06:13 UTC

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