My question is referring to immutability of smart contract data.
If I make a function in smart contract and write a conditional such that if a key of a map already exists jump out of the function and don't add it to the map.
i.e.
library Library {
struct data {
uint val;
bool isValue;
}
}
contract Array{
using Library for Library.data;
mapping(address => Library.data) map;
function addCluster(address id) {
if(map[id].isValue) throw; // duplicate key
// else insert a key value pair
}
}
Is this state then immutable?
I've heard that if majority consensus of a private network agrees then they can reverse or 'roll back' already mined transactions and blocks. As stated in this article under the private blockchain section https://www.multichain.com/blog/2017/05/blockchain-immutability-myth/.
I'm trying to understand what happens consensus of a private network decide to roll back to a particular block before that transaction had been mined, will that key/value pair (state) be deleted? Thus asking can state be immutable if it was programmed to in the contract.