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

Load PSBT error: Unable to decode PSBT #30070

Open
1 task done
foolbear opened this issue May 9, 2024 · 2 comments
Open
1 task done

Load PSBT error: Unable to decode PSBT #30070

foolbear opened this issue May 9, 2024 · 2 comments

Comments

@foolbear
Copy link

foolbear commented May 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current behaviour

"Load PSBT from ..." from menu, error shows:
Unable to decode PSBT Unsigned tx does not have empty scriptSigs and scriptWitnesses.: unspecified iostream_category error

decodepsbt and analyzepsbt show the same error too:
TX decode failed Unsigned tx does not have empty scriptSigs and scriptWitnesses.: unspecified iostream_category error (code -22)

Expected behaviour

I expect Load PSBT success.

And same procedure works fine in another wallet of test net. Both wallets are not watch-only

Steps to reproduce

I test PSBT in my wallet today, create a transaction in Bitcoin Core, click "send" and "create unsigned", then "Load PSBT from ..." from menu

I'm using prune mode for block chain. This address I made tx was obtained by importprivkey, and then covert to Descriptor Wallets by migratewallet.

I found the source code:

             case PSBT_GLOBAL_UNSIGNED_TX:
            {
                if (!key_lookup.emplace(key).second) {
                    throw std::ios_base::failure("Duplicate Key, unsigned tx already provided");
                } else if (key.size() != 1) {
                    throw std::ios_base::failure("Global unsigned tx key is more than one byte type");
                }
                CMutableTransaction mtx;
                // Set the stream to serialize with non-witness since this should always be non-witness
                UnserializeFromVector(s, TX_NO_WITNESS(mtx));
                tx = std::move(mtx);
                // Make sure that all scriptSigs and scriptWitnesses are empty
                for (const CTxIn& txin : tx->vin) {
                    if (!txin.scriptSig.empty() || !txin.scriptWitness.IsNull()) {
 ---->                  throw std::ios_base::failure("Unsigned tx does not have empty scriptSigs and scriptWitnesses.");
                    }
                }
                break;
            }

Relevant log output

no relevant log.

How did you obtain Bitcoin Core

Pre-built binaries

What version of Bitcoin Core are you using?

Bitcoin Core version v27.0.0

Operating system and version

MacOS 14.4.1

Machine specifications

No response

@willcl-ark willcl-ark added the PSBT label May 9, 2024
@maflcko
Copy link
Member

maflcko commented May 13, 2024

Are you able to reproduce in regtest, with exact steps to reproduce?

@foolbear
Copy link
Author

keywords: not watch-only wallet, prune mode, importprivkey, migratewallet.

"And same procedure works fine in another wallet of test net", but I cannot make an address with UTXOs from years ago(maybe have something to do with prune mode?).

@maflcko maflcko added the Wallet label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@foolbear @maflcko @willcl-ark and others