diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-07-03 16:58:28 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-01-23 16:35:08 -0500 |
commit | 501acb5538008d98abe79288b92040bc186b93f3 (patch) | |
tree | 14876627880b6972c45b4c3d1caabba2c521bd4f /src/script | |
parent | 81610eddbc57c46ae243f45d73e715d509f53a6c (diff) |
Always try to sign for all pubkeys in multisig
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/sign.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 8791d1542a..58eae3ce96 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -144,8 +144,13 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator ret.push_back(valtype()); // workaround CHECKMULTISIG bug 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, scriptPubKey, sigversion)) { - ret.push_back(std::move(sig)); + // 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, sigversion)) { + if (ret.size() < required + 1) { + ret.push_back(std::move(sig)); + } } } bool ok = ret.size() == required + 1; |