diff options
| author | Pieter Wuille <[email protected]> | 2011-06-20 11:10:58 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2011-06-20 11:10:58 -0700 |
| commit | 1179257bfd1d0f7742d57449b37c40c28464f152 (patch) | |
| tree | dcd42eff69a50111b29f7bdb7cad396dd49c6b7b /src/script.cpp | |
| parent | Merge pull request #332 from shanew/master (diff) | |
| parent | Bugfixes walletclass (diff) | |
| download | discoin-1179257bfd1d0f7742d57449b37c40c28464f152.tar.xz discoin-1179257bfd1d0f7742d57449b37c40c28464f152.zip | |
Merge pull request #334 from sipa/walletclass
Bugfixes walletclass
Diffstat (limited to 'src/script.cpp')
| -rw-r--r-- | src/script.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/script.cpp b/src/script.cpp index e1b5ae895..bd1b5b3c5 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -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; |