Limit transaction failure times

I just rebased this branch on the `setup-travis-ci` one. Make it much easier to merge. So, please accept the `setup-travis-ci` first then this.

@mahmoudimus

Or, if it is okay for you, I think it would be nice to grant me some permissions to this repo so that I can do this by myself.