I cracked the chain and it says it's still valid
// Someone's getting sneaky
Block *hackBlock = awesomeCoin.getLatestBlock();
cout << "Hash = " << hackBlock->getHash() << endl << "Previous Hash is " << hackBlock->getPreviousHash() << endl << "Is valid Hash? " << hackBlock->isHashValid() << endl;
//creo transactiondata fake con modificato solo ammontare e destinatario e stesso timestamp
TransactionData d(10000, hackBlock->data.senderKey, "Jon", hackBlock->data.timestamp);
Block b(hackBlock->getIndex(), d, hackBlock->getPreviousHash());
//stampa dell ultimo block della chain prima di provare a crakkare,dovrebbe essere tutto ok
//cout << "Hash = " << hackBlock->getHash() << endl << "Previous Hash is " << hackBlock->getPreviousHash() << endl << "Is valid Hash? " << hackBlock->isHashValid() << endl;
*hackBlock = b;
//test dopo modifica
//cout << "Hash = " << hackBlock->getHash() << endl << "Previous Hash is " << hackBlock->getPreviousHash() << endl << "Is valid Hash? " << hackBlock->isHashValid() << endl;
/*hackBlock->data.amount = 10000; // Oh yeah!
hackBlock->data.receiverKey = "Jon"; // mwahahahaha!
//cout << "Hash = " << hackBlock->getHash() << endl << "Previous Hash is " << hackBlock->getPreviousHash() << endl << "Is valid Hash? " << hackBlock->isHashValid() << endl;
*/
// Let's look at data
awesomeCoin.printChain();
// Awww! Why is it not valid?
printf("\nIs chain still valid? %d\n", awesomeCoin.isChainValid());
I cracked the chain and it says it's still valid
// Someone's getting sneaky
Block *hackBlock = awesomeCoin.getLatestBlock();
cout << "Hash = " << hackBlock->getHash() << endl << "Previous Hash is " << hackBlock->getPreviousHash() << endl << "Is valid Hash? " << hackBlock->isHashValid() << endl;
//creo transactiondata fake con modificato solo ammontare e destinatario e stesso timestamp
TransactionData d(10000, hackBlock->data.senderKey, "Jon", hackBlock->data.timestamp);
Block b(hackBlock->getIndex(), d, hackBlock->getPreviousHash());