Skip to content

Commit 501acb5

Browse files
committed
Always try to sign for all pubkeys in multisig
1 parent 81610ed commit 501acb5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/script/sign.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,13 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
144144
ret.push_back(valtype()); // workaround CHECKMULTISIG bug
145145
for (size_t i = 1; i < vSolutions.size() - 1; ++i) {
146146
CPubKey pubkey = CPubKey(vSolutions[i]);
147-
if (ret.size() < required + 1 && CreateSig(creator, sigdata, provider, sig, pubkey, scriptPubKey, sigversion)) {
148-
ret.push_back(std::move(sig));
147+
// We need to always call CreateSig in order to fill sigdata with all
148+
// possible signatures that we can create. This will allow further PSBT
149+
// processing to work as it needs all possible signature and pubkey pairs
150+
if (CreateSig(creator, sigdata, provider, sig, pubkey, scriptPubKey, sigversion)) {
151+
if (ret.size() < required + 1) {
152+
ret.push_back(std::move(sig));
153+
}
149154
}
150155
}
151156
bool ok = ret.size() == required + 1;

0 commit comments

Comments
 (0)