aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2018-11-08 10:08:46 -0500
committerAndrew Chow <achow101-github@achow101.com>2018-11-08 10:38:43 -0500
commit6b8d86ddb803d50d8608d95f7e8f791511dec8b9 (patch)
tree33a41f992ee78992960871af6b010dda8345cc10 /src
parent11e1ac3ae08535cefbd8235a8deb6cd100bcb2b1 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/script/sign.cpp2
1 files changed, 1 insertions, 1 deletions
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));