diff --git a/src/script/sign.cpp b/src/script/sign.cpp --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -157,10 +157,15 @@ ret.push_back(valtype()); for (size_t i = 1; i < vSolutions.size() - 1; ++i) { CPubKey pubkey = CPubKey(vSolutions[i]); - if (ret.size() < required + 1 && - CreateSig(creator, sigdata, provider, sig, pubkey, + // We need to always call CreateSig in order to fill sigdata + // with all possible signatures that we can create. This will + // allow further PSBT processing to work as it needs all + // possible signature and pubkey pairs + if (CreateSig(creator, sigdata, provider, sig, pubkey, scriptPubKey)) { - ret.push_back(std::move(sig)); + if (ret.size() < required + 1) { + ret.push_back(std::move(sig)); + } } } bool ok = ret.size() == required + 1;