This commit is contained in:
blackjok3r
2018-11-02 08:40:36 +08:00
parent 750f835106
commit aaab9bf85d

View File

@@ -1210,21 +1210,17 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
if (fExisted || IsMine(tx) || IsFromMe(tx) || noteData.size() > 0) if (fExisted || IsMine(tx) || IsFromMe(tx) || noteData.size() > 0)
{ {
uint256 hash; CTransaction txin;
CTransaction txin; if (GetTransaction(tx.vin[0].prevout.hash,txin,hash,false))
uint256 hashBlock; {
GetTransaction(tx.vin[0].prevout.hash,txin,hashBlock,false); printf("CHECKING THE script pubkey\n");
script = (uint8_t *)txin.vout[tx.vin[0].prevout.n].scriptPubKey.data();
fprintf(stderr, "vin tx hash: %s\n", tx.vin[0].prevout.hash.ToString().c_str()); if ( script[0] != 33 || script[34] != OP_CHECKSIG || memcmp(script+1,NOTARY_PUBKEY33,33) != 0 ) {
printf("vin 0 prevout is from some other kunt!\n");
fprintf(stderr, "vin 0 script pubkey : %s\n",txin.vout[0].scriptPubKey.ToString().c_str()); //return(-1);
}
CTxDestination address; printf("vin 0 prevvout is from our pubkey \n");
ExtractDestination(txin.vout[0].scriptPubKey, address); }
LOCK(cs_wallet);
if (!mapAddressBook.count(address))
fprintf(stderr, "vin 0 address is in my wallet \n" );
int64_t totalvoutvalue = 0; int64_t totalvoutvalue = 0;
for (size_t i = 0; i < tx.vout.size() ; i++) { for (size_t i = 0; i < tx.vout.size() ; i++) {