Is it possible to get the transaction hash before sending the transaction? Just because it sometimes takes really long until the callback with the txHash comes in.
const transaction = new Tx(txData);
transaction.sign(privateKey);
const serializedTx = transaction.serialize().toString('hex');
web3.eth.sendSignedTransaction('0x' + serializedTx, cb);
I need to save the transaction hash in my DB. The best way would be to store it there ASAP. So, is there a way to calculate the Txhash BEFORE sending the transaction with sendSignedTransaction?