Fix so that read-only transactions actually do have transaction state
Merge pull request #2606 from rickardoberg/readonlytxfix

Fix so that read-only transactions actually do have transaction state