From 6b8d86ddb803d50d8608d95f7e8f791511dec8b9 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Thu, 8 Nov 2018 10:08:46 -0500 Subject: Require a public key to be retrieved when signing a P2PKH input If we do not have the public key for a P2PKH input, we should not continue to attempt to sign for it. --- src/script/sign.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script') diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 89cc7c808c..68ceea7e6f 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -123,7 +123,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator case TX_PUBKEYHASH: { CKeyID keyID = CKeyID(uint160(vSolutions[0])); CPubKey pubkey; - GetPubKey(provider, sigdata, keyID, pubkey); + if (!GetPubKey(provider, sigdata, keyID, pubkey)) return false; if (!CreateSig(creator, sigdata, provider, sig, pubkey, scriptPubKey, sigversion)) return false; ret.push_back(std::move(sig)); ret.push_back(ToByteVector(pubkey)); -- cgit v1.2.3