@@ -1326,12 +1326,16 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
13261326bool Sign1 (const CKeyID& address, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet)
13271327{
13281328 CKey key;
1329- if (!keystore.GetKey (address, key))
1329+ if (!keystore.GetKey (address, key)) {
1330+ printf (" could not find the right key ******************" );
13301331 return false ;
1332+ }
13311333
13321334 vector<unsigned char > vchSig;
1333- if (!key.Sign (hash, vchSig))
1335+ if (!key.Sign (hash, vchSig)) {
1336+ printf (" signing failed :( *****************" );
13341337 return false ;
1338+ }
13351339 vchSig.push_back ((unsigned char )nHashType);
13361340 scriptSigRet << vchSig;
13371341
@@ -1371,12 +1375,17 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
13711375 switch (whichTypeRet)
13721376 {
13731377 case TX_NONSTANDARD :
1378+ printf (" ****************** tx is not standard" );
13741379 return false ;
13751380 case TX_PUBKEY :
13761381 keyID = CPubKey (vSolutions[0 ]).GetID ();
1382+ printf (" ***************** tx is pubkey: %s" , keyID.ToString ());
1383+ printf (" \n " );
13771384 return Sign1 (keyID, keystore, hash, nHashType, scriptSigRet);
13781385 case TX_PUBKEYHASH :
13791386 keyID = CKeyID (uint160 (vSolutions[0 ]));
1387+ printf (" ***************** tx is pubkeyhash: %s" , uint160 (vSolutions[0 ]));
1388+ printf (" \n " );
13801389 if (!Sign1 (keyID, keystore, hash, nHashType, scriptSigRet))
13811390 return false ;
13821391 else
@@ -1387,13 +1396,16 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
13871396 }
13881397 return true ;
13891398 case TX_SCRIPTHASH :
1399+ printf (" ***************** tx is scripthash" );
13901400 return keystore.GetCScript (uint160 (vSolutions[0 ]), scriptSigRet);
13911401
13921402 case TX_MULTISIG :
1403+ printf (" ***************** tx is multisig" );
13931404 scriptSigRet << OP_0 ; // workaround CHECKMULTISIG bug
13941405 return (SignN (vSolutions, keystore, hash, nHashType, scriptSigRet));
13951406 case TX_NULL_DATA :
1396- return true ;
1407+ printf (" **************** tx is null data" );
1408+ return true ;
13971409 }
13981410 return false ;
13991411}
@@ -1613,8 +1625,10 @@ bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CTransa
16131625 uint256 hash = SignatureHash (fromPubKey, txTo, nIn, nHashType);
16141626
16151627 txnouttype whichType;
1616- if (!Solver (keystore, fromPubKey, hash, nHashType, txin.scriptSig , whichType))
1628+ if (!Solver (keystore, fromPubKey, hash, nHashType, txin.scriptSig , whichType)) {
1629+ printf (" ******************** solver failed :(" );
16171630 return false ;
1631+ }
16181632
16191633 if (whichType == TX_SCRIPTHASH )
16201634 {
0 commit comments