My contract is
pragma solidity ^0.4.11;
contract UserBasic {
struct Record {
bytes32 _id;
address _addedBy;
uint _dateAdded;
bytes32 _transactionHash;
bytes32 _type;
bytes32 _hash;
bytes32 _signature;
}
// Type to records array
mapping(bytes32 => bytes32[]) typeRecords;
// Record ID to record
mapping(bytes32 => Record) idRecord;
// Add a record
function addRecord(bytes32 _type, bytes32 _id) {
typeRecords[_type].push(_id);
var _new = Record(_id, tx.origin, now, "", _type, "", "");
idRecord[_id] = _new;
}
}
Whenever someone calls addRecord I'd like that transaction's hash to be the
bytes32 _transactionHash;
of the new record being created. I looked through the solidity docs but couldn't find anything there. Is this possible?