use a tx counter on sending instead of OnTxAccepted

also renamed vars for consistency