@@ -1358,12 +1358,16 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
13581358bool Sign1 (const CKeyID& address, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet)
13591359{
13601360 CKey key;
1361- if (!keystore.GetKey (address, key))
1361+ if (!keystore.GetKey (address, key)) {
1362+ printf (" could not find the right key ******************" );
13621363 return false ;
1364+ }
13631365
13641366 vector<unsigned char > vchSig;
1365- if (!key.Sign (hash, vchSig))
1367+ if (!key.Sign (hash, vchSig)) {
1368+ printf (" signing failed :( *****************" );
13661369 return false ;
1370+ }
13671371 vchSig.push_back ((unsigned char )nHashType);
13681372 scriptSigRet << vchSig;
13691373
@@ -1403,12 +1407,17 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
14031407 switch (whichTypeRet)
14041408 {
14051409 case TX_NONSTANDARD :
1410+ printf (" ****************** tx is not standard" );
14061411 return false ;
14071412 case TX_PUBKEY :
14081413 keyID = CPubKey (vSolutions[0 ]).GetID ();
1414+ printf (" ***************** tx is pubkey: %s" , keyID.ToString ());
1415+ printf (" \n " );
14091416 return Sign1 (keyID, keystore, hash, nHashType, scriptSigRet);
14101417 case TX_PUBKEYHASH :
14111418 keyID = CKeyID (uint160 (vSolutions[0 ]));
1419+ printf (" ***************** tx is pubkeyhash: %s" , uint160 (vSolutions[0 ]));
1420+ printf (" \n " );
14121421 if (!Sign1 (keyID, keystore, hash, nHashType, scriptSigRet))
14131422 return false ;
14141423 else
@@ -1419,13 +1428,16 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
14191428 }
14201429 return true ;
14211430 case TX_SCRIPTHASH :
1431+ printf (" ***************** tx is scripthash" );
14221432 return keystore.GetCScript (uint160 (vSolutions[0 ]), scriptSigRet);
14231433
14241434 case TX_MULTISIG :
1435+ printf (" ***************** tx is multisig" );
14251436 scriptSigRet << OP_0 ; // workaround CHECKMULTISIG bug
14261437 return (SignN (vSolutions, keystore, hash, nHashType, scriptSigRet));
14271438 case TX_NULL_DATA :
1428- return true ;
1439+ printf (" **************** tx is null data" );
1440+ return true ;
14291441 }
14301442 return false ;
14311443}
@@ -1645,8 +1657,10 @@ bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CTransa
16451657 uint256 hash = SignatureHash (fromPubKey, txTo, nIn, nHashType);
16461658
16471659 txnouttype whichType;
1648- if (!Solver (keystore, fromPubKey, hash, nHashType, txin.scriptSig , whichType))
1660+ if (!Solver (keystore, fromPubKey, hash, nHashType, txin.scriptSig , whichType)) {
1661+ printf (" ******************** solver failed :(" );
16491662 return false ;
1663+ }
16501664
16511665 if (whichType == TX_SCRIPTHASH )
16521666 {
0 commit comments