
signrawtransactionwithkey get me confusing error message even when hash160(redeemScript) != scriptPubKey.
Obviously `hash 160 (redeemScript)! = ScriptPubKey`
If so, why do not give me a better message?

```
signrawtransactionwithkey  "0200000001cfe62b9f1c52bc2998f9a0e6d6ee35430c93ec653d5691935178147a43090fee0000000000ffffffff01f0afd320766191d4c5c088ac00000000" "[\"cSXHtKRXWnCLWhuie8WC13cKF3qdnKL8vG3BiRpxgCXZkK2CHe9u\"]"  "[{\"txid\":\"ee0f09437a1478519391563d65ec930c4335eed6e6a0f99829bc521c9f2be6cf\",\"vout\":0,\"scriptPubKey\":\"a914111111111111111111111111111111111111111187\",\"redeemScript\":\"5221033d9aecbced8e776c03d283f6c0d64c6a301ad142d74d500fe8860c9b362fa4932102a4df3cb4e5286e180b7c68e323c778e32350a604d4f4a74c290d1c60c721687a52ae\"}]"
{
  "hex": "0200000001cfe62b9f1c52bc2998f9a0e6d6ee35430c93ec653d5691935178147a43090fee0000000000ffffffff01f0a29a3b000000001976a9146eeff5b6a0960be69ad0941fd320766191d4c5c088ac00000000",
  "complete": false,
  "errors": [
    {
      "txid": "ee0f09437a1478519391563d65ec930c4335eed6e6a0f99829bc521c9f2be6cf",
      "vout": 0,
      "witness": [
      ],
      "scriptSig": "",
      "sequence": 4294967295,
      **"error": "Unable to sign input, invalid stack size (possibly missing key)"**
    }
  ]
}

signrawtransactionwithkey  "0200000001cfe62b9f1c52bc2998f9a0e6d6ee35430c93ec653d5691935178147a43090fee0000000000ffffffff01f0afd320766191d4c5c088ac00000000" "[\"cSXHtKRXWnCLWhuie8WC13cKF3qdnKL8vG3BiRpxgCXZkK2CHe9u\"]"  "[{\"txid\":\"ee0f09437a1478519391563d65ec930c4335eed6e6a0f99829bc521c9f2be6cf\",\"vout\":0,\"scriptPubKey\":\"a914648a73e6a0db686b547a66b7b38f3f7af61f50ae87\",\"redeemScript\":\"52211111111111111111111111111111111111111111111111111111111111111111112102a4df3cb4e5286e180b7c68e323c778e32350a604d4f4a74c290d1c60c721687a52ae\"}]"
{
  "hex": "0200000001cfe62b9f1c52bc2998f9a0e6d6ee35430c93ec653d5691935178147a43090fee0000000000ffffffff01f0a29a3b000000001976a9146eeff5b6a0960be69ad0941fd320766191d4c5c088ac00000000",
  "complete": false,
  "errors": [
    {
      "txid": "ee0f09437a1478519391563d65ec930c4335eed6e6a0f99829bc521c9f2be6cf",
      "vout": 0,
      "witness": [
      ],
      "scriptSig": "",
      "sequence": 4294967295,
      **"error": "Unable to sign input, invalid stack size (possibly missing key)"**
    }
  ]
}

signrawtransactionwithkey  "0200000001cfe62b9f1c52bc2998f9a0e6d6ee35430c93ec653d5691935178147a43090fee0000000000ffffffff01f0afd320766191d4c5c088ac00000000" "[\"cSXHtKRXWnCLWhuie8WC13cKF3qdnKL8vG3BiRpxgCXZkK2CHe9u\"]"  "[{\"txid\":\"ee0f09437a1478519391563d65ec930c4335eed6e6a0f99829bc521c9f2be6cf\",\"vout\":0,\"scriptPubKey\":\"a914648a73e6a0db686b547a66b7b38f3f7af61f50ae87\",\"redeemScript\":\"5221033d9aecbced8e776c03d283f6c0d64c6a301ad142d74d500fe8860c9b362fa4932111111111111111111111111111111111111111111111111111111111111111111152ae\"}]"
{
  "hex": "0200000001cfe62b9f1c52bc2998f9a0e6d6ee35430c93ec653d5691935178147a43090fee0000000000ffffffff01f0a29a3b000000001976a9146eeff5b6a0960be69ad0941fd320766191d4c5c088ac00000000",
  "complete": false,
  "errors": [
    {
      "txid": "ee0f09437a1478519391563d65ec930c4335eed6e6a0f99829bc521c9f2be6cf",
      "vout": 0,
      "witness": [
      ],
      "scriptSig": "",
      "sequence": 4294967295,
      "error": "Unable to sign input, invalid stack size (possibly missing key)"
    }
  ]
}

```
<What behavior did you expect?>
"error": "Unable to sign input, the scriptPubKey does not match redeemScript”

<What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? >
```
./bitcoind --version
Bitcoin Core Daemon version v0.16.99.0-81d0d565a
Copyright (C) 2009-2018 The Bitcoin Core developers

```
if (!destinations.insert(destination).second) {
                throw JSONRPCError(RPC_INVALID_PARAMETER, std::string("Invalid parameter, duplicated address: ") + name_);
            }
            CScript scriptPubKey = GetScriptForDestination(destination);
            CAmount nAmount = AmountFromValue(outputs[name_]);
            CTxOut out(nAmount, scriptPubKey);
            rawTx.vout.push_back(out);
        }
    }
    if (rbf && rawTx.vin.size() > 0 && !SignalsOptInRBF(CTransaction(rawTx))) {
        throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter combination: Sequence number(s) contradict replaceable option");
    }
    return rawTx;
}
static void TxInErrorToJSON(const CTxIn& txin, UniValue& vErrorsRet, const std::string& strMessage)
{
    UniValue entry(UniValue::VOBJ);
    entry.pushKV("txid", txin.prevout.hash.ToString());
    entry.pushKV("vout", (uint64_t)txin.prevout.n);
    UniValue witness(UniValue::VARR);
    for (unsigned int i = 0; i < txin.scriptWitness.stack.size(); i++) {
        witness.push_back(HexStr(txin.scriptWitness.stack[i].begin(), txin.scriptWitness.stack[i].end()));
    }
    entry.pushKV("witness", witness);
    entry.pushKV("scriptSig", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()));
    entry.pushKV("sequence", (uint64_t)txin.nSequence);
    entry.pushKV("error", strMessage);
    vErrorsRet.push_back(entry);
}
void ParsePrevouts(const UniValue& prevTxsUnival, FillableSigningProvider* keystore, std::map<COutPoint, Coin>& coins)