mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Bugfixes walletclass
Some problems found by ius: * compiler complains with no return after critical section block * CKeyStore::GetPrivKey(key) was undefined for unknown key * missing return statement in GetChange()
This commit is contained in:
@@ -1038,12 +1038,13 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
|
||||
{
|
||||
// Sign
|
||||
const valtype& vchPubKey = item.second;
|
||||
if (!keystore.HaveKey(vchPubKey))
|
||||
CPrivKey privkey;
|
||||
if (!keystore.GetPrivKey(vchPubKey, privkey))
|
||||
return false;
|
||||
if (hash != 0)
|
||||
{
|
||||
vector<unsigned char> vchSig;
|
||||
if (!CKey::Sign(keystore.GetPrivKey(vchPubKey), hash, vchSig))
|
||||
if (!CKey::Sign(privkey, hash, vchSig))
|
||||
return false;
|
||||
vchSig.push_back((unsigned char)nHashType);
|
||||
scriptSigRet << vchSig;
|
||||
@@ -1056,12 +1057,13 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
|
||||
if (mi == mapPubKeys.end())
|
||||
return false;
|
||||
const vector<unsigned char>& vchPubKey = (*mi).second;
|
||||
if (!keystore.HaveKey(vchPubKey))
|
||||
CPrivKey privkey;
|
||||
if (!keystore.GetPrivKey(vchPubKey, privkey))
|
||||
return false;
|
||||
if (hash != 0)
|
||||
{
|
||||
vector<unsigned char> vchSig;
|
||||
if (!CKey::Sign(keystore.GetPrivKey(vchPubKey), hash, vchSig))
|
||||
if (!CKey::Sign(privkey, hash, vchSig))
|
||||
return false;
|
||||
vchSig.push_back((unsigned char)nHashType);
|
||||
scriptSigRet << vchSig << vchPubKey;
|
||||
|
||||
Reference in New Issue
Block a user