Updated to handle flags in the input tx_json