@ -1038,12 +1038,13 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
{
{
// Sign
// Sign
const valtype & vchPubKey = item . second ;
const valtype & vchPubKey = item . second ;
if ( ! keystore . HaveKey ( vchPubKey ) )
CPrivKey privkey ;
if ( ! keystore . GetPrivKey ( vchPubKey , privkey ) )
return false ;
return false ;
if ( hash ! = 0 )
if ( hash ! = 0 )
{
{
vector < unsigned char > vchSig ;
vector < unsigned char > vchSig ;
if ( ! CKey : : Sign ( keystore . GetPrivKey ( vchPubKey ) , hash , vchSig ) )
if ( ! CKey : : Sign ( privkey , hash , vchSig ) )
return false ;
return false ;
vchSig . push_back ( ( unsigned char ) nHashType ) ;
vchSig . push_back ( ( unsigned char ) nHashType ) ;
scriptSigRet < < vchSig ;
scriptSigRet < < vchSig ;
@ -1056,12 +1057,13 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
if ( mi = = mapPubKeys . end ( ) )
if ( mi = = mapPubKeys . end ( ) )
return false ;
return false ;
const vector < unsigned char > & vchPubKey = ( * mi ) . second ;
const vector < unsigned char > & vchPubKey = ( * mi ) . second ;
if ( ! keystore . HaveKey ( vchPubKey ) )
CPrivKey privkey ;
if ( ! keystore . GetPrivKey ( vchPubKey , privkey ) )
return false ;
return false ;
if ( hash ! = 0 )
if ( hash ! = 0 )
{
{
vector < unsigned char > vchSig ;
vector < unsigned char > vchSig ;
if ( ! CKey : : Sign ( keystore . GetPrivKey ( vchPubKey ) , hash , vchSig ) )
if ( ! CKey : : Sign ( privkey , hash , vchSig ) )
return false ;
return false ;
vchSig . push_back ( ( unsigned char ) nHashType ) ;
vchSig . push_back ( ( unsigned char ) nHashType ) ;
scriptSigRet < < vchSig < < vchPubKey ;
scriptSigRet < < vchSig < < vchPubKey ;