My smart contract looks like this
contract C {
uint256 a=50; //
function setA(uint256 aval) {
a = aval;
}
function getA() constant returns (uint256) {
return a;
}
}
I am calling the function asynchronously like this
var a = contract.setA.call(100, function(error, value) {
.....
});
After that if I call this immediately
var a = contract.getA.call(function(error, value) {
.....
});
I am getting the same value(50) before the transaction is mined. This is because it needs some time if I want to get the changed value. Is there any way or event so that I get notification that the changed value is updated in blockchain when I can getA to be ensured the current exact value?